Import
Description
A drawer (side panel) component that slides in from the edge of the screen. Based on the Vaul library, it provides a smooth sliding animation and supports multiple directions.High-Level API
Props
Component that triggers the drawer when clicked
The drawer title
Description text shown below the title
Main content area of the drawer
Initial open state when uncontrolled
Current open state for controlled usage
When false, allows interaction outside the drawer without closing it
Direction from which the drawer slides in
When false, prevents closing via dragging, clicking outside, or pressing Esc
When true, dragging only works on the handle element
Container element selector. Defaults to document.body
Whether to reposition inputs when drawer opens
Array of snap points as percentages (0-100) or px values
Current active snap point
Snap point index from which to apply overlay fade
Whether to snap to sequential points
Event Handlers
Fires when drawer opens or closes
Triggered after open/close animation ends. Receives final open state
Function to set the active snap point by index
Compositional API
drawer.root()
Root component containing all drawer parts.Initial open state
Controlled open state
Modal behavior
Slide direction
Whether drawer can be dismissed
Restrict dragging to handle only
Container element
Input repositioning
Snap point positions
Active snap point
Fade start index
Sequential snapping
drawer.trigger()
Button that opens the drawer.Render trigger as child element
Custom component to render
drawer.portal()
Portals drawer into the body.drawer.overlay()
Layer that covers the inert portion of the view.Render as child element
drawer.content()
Container for drawer contents.Render as child element
drawer.close()
Button that closes the drawer.Render as child element
drawer.title()
Accessible title announced when drawer opens.Render as child element
drawer.description()
Accessible description announced when drawer opens.Render as child element
drawer.handle()
Optional handle for dragging the drawer.Class Names
Access default class names viadrawer.class_names:
ROOT: Root container stylingTRIGGER: Trigger button stylingPORTAL: Portal stylingCONTENT: Content container stylingOVERLAY: Overlay background stylingCLOSE: Close button stylingTITLE: Title text stylingDESCRIPTION: Description text stylingHANDLE: Drag handle styling