
- Location:
sabo/src/components/ui/drawer.tsx
When to use
- Show contextual panels without leaving the page.
- Use for mobile nav, filters, details, or quick actions.
Usage
Key props
DrawerContent
Main panel container. Direction and animations are handled by Vaul; content styling via Tailwind.
DrawerTrigger
Click target to open the drawer.
DrawerClose
Click target to close the drawer.
DrawerOverlay
Backdrop overlay behind the drawer.
DrawerPortal
Portal root for overlay/content.
Header/footer container sections inside content.
DrawerTitle/DrawerDescription
Title and description text wrappers.
This component forwards all props from vaul Drawer primitives (Root/Trigger/Content/Close, etc.). Above are commonly used props. For the full API, see the vaul docs: https://vaul.emilkowal.ski/
Styling tip
Add padding insideDrawerContent and maintain visible focus states.
Accessibility
- Drawer traps focus inside when open; escape key dismisses it.
- Ensure the trigger has a descriptive label; use
aria-labelif needed.