API reference
The Drawer export is an object that groups every subcomponent.
Drawer.Root
The state container. Every other subcomponent must be rendered inside one (or inside Drawer.NestedRoot).
Drawer.NestedRoot
Same props as Drawer.Root. Use when nesting a drawer inside another drawer's content.
Drawer.Trigger
Aliased to DialogPrimitive.Trigger. Accepts asChild to slot into a custom element.
Drawer.Portal
Aliased to DialogPrimitive.Portal. Renders children into a portal so the drawer escapes ancestor stacking contexts.
Drawer.Overlay
The dimmed scrim behind the drawer. Click-through closes the drawer when dismissible is true.
Drawer.Content
The draggable surface. Accepts every standard div prop.
Drawer.Handle
A small grab affordance. Cycles through snap points on click when focused.
Drawer.Close
Aliased to DialogPrimitive.Close.
Drawer.Title
Aliased to DialogPrimitive.Title. Required for accessibility. Use a visually hidden style if you do not want it shown.
Drawer.Description
Aliased to DialogPrimitive.Description. Pair with Drawer.Title for a complete a11y description, or pass aria-describedby={undefined} on Drawer.Content to opt out.
DOM attributes
The library writes a handful of attributes you can target from CSS.