api
Compound API
Every prop, type, and default. All components also forward standard HTML attributes — className, style, data-*, event handlers.
Drawer.Root
boolean
Controlled open state. Pair with onOpenChange.
boolean
Uncontrolled initial open state.
(open: boolean) => void
Called whenever the drawer opens or closes.
"top" | "bottom" | "left" | "right"
Which edge the drawer slides from. Determines gesture axis and transform direction.
"default" | "floating" | "sheet" | "fullscreen" | "nested" | "stack"
Visual mode. Affects border radius, margin, and animation preset.
boolean
Locks page scroll and traps focus inside the drawer while open.
boolean
Whether overlay click and Escape key close the drawer.
SnapPoint[]
Snap positions. number = px from edge, "25%" = fraction of viewport, "content" = content height.
number
Controlled snap index. 0 is the smallest point, length - 1 is the largest.
(index: number) => void
Called when the active snap index changes after a drag.
number
Fraction of the drawer height that must be dragged before auto-close triggers on release.
boolean
Elastic resistance when dragging past the open or closed extent.
boolean
Uses release velocity to project the landing snap point. Fast flick = skip a snap.
boolean
Scales the page element behind the drawer down when open. Add data-hiraki-background to the element to scale.
(data: GestureCallbackData) => void
Fires once when a drag gesture is confirmed (after axis lock).
(data: GestureCallbackData) => void
Fires on every pointer move during a drag.
(data: GestureCallbackData) => void
Fires when the pointer is released, with final velocity and translate.
Drawer.Portal
HTMLElement | null
DOM node to portal into. Defaults to document.body.
Drawer.Trigger
boolean
Merges props onto the child element instead of rendering a button.
Drawer.Close
boolean
Merges props onto the child element instead of rendering a button.
Drawer.Handle
boolean
Controls whether the handle pill is rendered.
boolean
When true, drag gestures only start from the handle, not the full content area.
Drawer.Content
React.HTMLAttributes<HTMLDivElement>
All standard div props forwarded. Use className to apply your own styles.
Drawer.Overlay
React.HTMLAttributes<HTMLDivElement>
All standard div props forwarded. Opacity tracks drag progress via direct DOM mutation.