Drawer
7 partsDemo
Anatomy
Import the parts and compose them. Each part forwards attributes to its underlying element.
import {
DrawerRoot,
DrawerRootNested,
DrawerContent,
DrawerOverlay,
DrawerHandle,
DrawerTrigger,
DrawerClose,
} from '@robonen/primitives/overlays/drawer';
<DrawerRoot>
<DrawerRootNested />
<DrawerContent />
<DrawerOverlay />
<DrawerHandle />
<DrawerTrigger />
<DrawerClose />
</DrawerRoot>API Reference
DrawerRoot
RootNo props or events — renders its element and forwards attributes.
DrawerRootNested
RootNestedNo props or events — renders its element and forwards attributes.
DrawerContent
ContentThe draggable drawer panel. Wraps Dialog's Content (so it keeps focus trapping, scroll locking, and dismissal) and adds the pointer-drag gesture, snap-point positioning, and the `data-drawer-*` hooks the CSS animates. Bring your own size/colour/padding via `class`/`style`.
No props or events — renders its element and forwards attributes.
DrawerOverlay
OverlayThe dimming layer behind the drawer. Wraps Dialog's Overlay and exposes the `data-drawer-overlay` hooks so its opacity can fade in step with the drag and with snap points. Only renders for modal drawers.
No props or events — renders its element and forwards attributes.
DrawerHandle
HandleNo props or events — renders its element and forwards attributes.
DrawerTrigger
TriggerThe button that toggles the drawer open. A thin wrapper over Dialog's Trigger that tags the resulting `update:open` with the `trigger-press` reason.
No props or events — renders its element and forwards attributes.
DrawerClose
CloseA button that closes the drawer when activated. A thin wrapper over Dialog's Close that tags the resulting `update:open` with the `close-press` reason.
No props or events — renders its element and forwards attributes.