Components

Base Drawer

A swipe-gesture drawer built on Base UI's official Drawer component with snap points, nested stacking, and indent effects

Preview

Installation

Usage

Examples

Side Drawer

Use position="right" to create a side drawer.

Directions

Open drawers from any screen edge using the position prop.

Controlled

Use the open and onOpenChange props to control the drawer's open state externally.

Drawer is closed

Snap Points

Configure multiple snap points for the drawer to rest at different heights. Numbers between 0 and 1 represent fractions of the viewport height. String values support px and rem units.

Floating Variant

Use variant="floating" for a card-like appearance with inset spacing and fully rounded corners on desktop.

Use variant="inset" on BaseDrawerFooter for a visually separated footer with a border-top and muted background.

Nested Drawers

Drawers can be nested. Each drawer remains independently focus managed while stacking visually with scale and translate animations.

Indent Effect

Use BaseDrawerProvider, BaseDrawerIndentBackground, and BaseDrawerIndent to scale and round the background content when a drawer opens.

The content behind the drawer scales and rounds when the drawer opens.

With Form

Include form elements within the drawer. BaseDrawerPanel wraps content in Drawer.Content by default, enabling text selection without triggering swipe gestures.

Scrollable Content

Use BaseDrawerPanel for scrollable content that works seamlessly with swipe gestures.

API Reference

Built on Base UI's Drawer. All Base UI Drawer props are supported.

Props

BaseDrawer

Root component that manages drawer state. Wraps Base UI's Drawer.Root.

Prop

BaseDrawerPopup

Convenience composite that renders Portal + Backdrop + Viewport + Popup. This is the main content wrapper.

Prop

BaseDrawerPanel

Scrollable content area. Wraps ScrollArea and Drawer.Content for text selection support.

Prop

BaseDrawerFooter

Prop

Components

ComponentDescription
BaseDrawerRoot component with position context
BaseDrawerTriggerButton that opens the drawer
BaseDrawerPopupConvenience composite (Portal + Backdrop + Viewport + Popup)
BaseDrawerBarDrag handle indicator (adapts orientation per position)
BaseDrawerHeaderContainer for title and description
BaseDrawerTitleAccessible title element
BaseDrawerDescriptionAccessible description element
BaseDrawerPanelScrollable content area with text selection support
BaseDrawerFooterContainer for action buttons
BaseDrawerCloseButton that closes the drawer
BaseDrawerContentPass-through to Drawer.Content for text selection in custom layouts
BaseDrawerMenuNavigation menu container
BaseDrawerMenuItemMenu item button
BaseDrawerMenuTriggerMenu item that opens a nested drawer
BaseDrawerMenuSeparatorMenu divider
BaseDrawerMenuGroupMenu item group
BaseDrawerMenuGroupLabelGroup label
BaseDrawerMenuCheckboxItemCheckbox menu item (default or switch variant)
BaseDrawerMenuRadioGroupRadio group container
BaseDrawerMenuRadioItemRadio menu item
BaseDrawerProviderShared context for indent effect
BaseDrawerIndentApp content wrapper for indent/scale effect
BaseDrawerIndentBackgroundBackground layer behind indent
BaseDrawerSwipeAreaInvisible area for swipe-to-open gestures

CSS Variables

Base UI's Drawer exposes CSS custom properties on the popup element:

VariableDescription
--drawer-swipe-progressProgress toward dismissed (0 = open, 1 = dismissed)
--drawer-swipe-movement-xHorizontal swipe offset in pixels
--drawer-swipe-movement-yVertical swipe offset in pixels
--drawer-swipe-strengthVelocity-based strength (scales exit animation duration)
--drawer-snap-point-offsetVertical offset for snap point positioning
--drawer-heightCurrent drawer height
--drawer-frontmost-heightHeight of the frontmost drawer in a nested stack
--nested-drawersNumber of nested drawers open