Drawer
Root component for a drawer (mobile-friendly slide-up panel). Manages
open/closed state; swipeDirection sets the edge it slides from and the
direction that dismisses it ("down" for a bottom drawer, the default).
Pass container to portal the drawer (and its scrim) into
a bounded element instead of the document body - used by the mobile-nav
overlay to scope the drawer to its own layer.
Import from "@instruments/materia-ui/components/drawer".
Usage
Best practices
Drawer is the touch-first slide-up panel - reach for
Sheetfor desktop side panels andDialogfor centred modals.Always render a
DrawerTitleinsideDrawerContent(sr-only if visually hidden) - the underlying primitive uses it foraria-labelledby.Pass
containerto scope the drawer and its scrim to a bounded element instead of the viewport (the mobile-nav overlay pattern).
Props
Drawer
DrawerContent
DrawerDescription
DrawerOverlay
DrawerTitle
Also exports
- component
DrawerClose - component
DrawerFooter - component
DrawerHeader - component
DrawerPortal - namespace
DrawerPrimitive - component
DrawerTrigger
Composition
Builds on
Used by