Drawer
A panel that slides in from an edge of the screen and can be dismissed with a swipe gesture, built on the Base UI Drawer primitive.
Installation
Bash
Usage
Examples
Snap points
API reference
Drawer
Extends the Base UI Drawer Root — a real, standalone Base UI component (no vaul); the Radix-free replacement for the classic shadcn/vaul drawer. All Dialog-style root props apply, plus the drawer-specific ones:
| Prop | Type | Default |
|---|---|---|
open / defaultOpen | boolean | false |
onOpenChange | (open: boolean) => void | — |
swipeDirection | "down" | "up" | "left" | "right" | "down" |
snapPoints | number[] — resting heights (0–1) | — |
showSwipeHandle | boolean — grab handle in the content | false |
modal | true | false | "trap-focus" | true |
disablePointerDismissal | boolean | false |
DrawerContent
Includes the mandatory Drawer.Viewport internally — it owns the
swipe-gesture engine (without it, swipe-to-dismiss silently does
nothing). Add data-base-ui-swipe-ignore to an element inside to opt it
out of swipe handling; interactive elements (buttons, inputs, links) are
ignored automatically.
DrawerSwipeHandle
The grab handle bar — rendered automatically when showSwipeHandle is
set on the root, or compose it manually.
DrawerTrigger, DrawerClose, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, DrawerOverlay, DrawerPortal
Styled parts; trigger and close accept the render prop. Advanced
primitive features (snapPoint/onSnapPointChange control,
Drawer.SwipeArea swipe-to-open, the nested-drawer
Drawer.Indent effect) remain available by composing
@base-ui/react/drawer directly.