Drawer
Bottom sheet with a grab handle and pointer drag-to-dismiss on Dialog primitives.
Drawer is a bottom sheet: a grab handle, a rounded top edge, and pointer
drag-to-dismiss — the sheet tracks the finger and closes past
dismissThreshold. Keyboard and Escape dismissal always work (Dialog
primitives underneath).
Installation
import {
Drawer, DrawerTrigger, DrawerClose, DrawerContent,
DrawerHeader, DrawerTitle, DrawerDescription, DrawerFooter,
} from "@iammikz/srui";
Usage
Exports
| Export | Notes |
|---|---|
Drawer | Root; open/onOpenChange for controlled use |
DrawerTrigger / DrawerClose | Toggle/target closes |
DrawerContent | The sheet; dismissThreshold (default 0.33) |
DrawerHeader / DrawerTitle / DrawerDescription / DrawerFooter | Structure |
Accessibility
Dialog semantics: labelled sheet, focus trap, Escape/overlay dismissal.
The drag handle is aria-hidden — dragging is a pointer convenience, never
the only way out.
Upgrades over the PRUI original: real pointer drag-to-dismiss with a configurable threshold (no extra dependency).