Skip to content
SevenUI
Sign in
On this page

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:

PropTypeDefault
open / defaultOpenbooleanfalse
onOpenChange(open: boolean) => void—
swipeDirection"down" | "up" | "left" | "right""down"
snapPointsnumber[] — resting heights (0–1)—
showSwipeHandleboolean — grab handle in the contentfalse
modaltrue | false | "trap-focus"true
disablePointerDismissalbooleanfalse

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.

Was this page helpful?