Skip to main content

Common Examples

To use the BottomSheet, pass the required title and content props. Open it with a Carto Button through trigger, or control it with isOpen and onOpenChange.

Body content

Unlike Dialog, the sheet’s content is a general body region for forms, lists, and composed layouts.

Subheader

Pass a short subheader to provide context beneath the title.

Close button

The header close button appears by default. Set showCloseButton={false} to remove it. The sheet remains dismissable through the drag handle, backdrop, and Escape.

Scrolling body

Content beyond the current detent scrolls inside the body while the handle and header remain visible.

Controlled state

Omit trigger and pass isOpen with onOpenChange when an event or another component opens the sheet.

Internationalization

Localize title, subheader, and content before passing them to BottomSheet. The component uses these messages for built-in controls:
  • ai-kit.bottomSheet.close
  • ai-kit.bottomSheet.resize
  • ai-kit.bottomSheet.resizeValue
Mount AiKitIntlProvider inside CartoTheme to switch locale or override them. resizeValue receives a {percent} value.

React Accessibility

  • The required title labels the modal through aria-labelledby. subheader is associated through aria-describedby.
  • The drag handle is a vertical slider. Arrow keys move between detents and expose the current viewport percentage.
  • The body is always keyboard-focusable so keyboard users can scroll plain content.
  • React Aria supplies focus trapping and restoration, scroll lock, aria-modal, Escape dismissal, and outside-interaction dismissal.
Last modified on August 28, 2026