shadcn.io is not affiliated with official shadcn/ui
Drawer examples · Left
Left Drawer with Nested Items for React
A left drawer menu whose Products and Orders sections expand to show their sub-items.
A left drawer with a two-level menu. Dashboard and Analytics are single buttons; Products and Orders are Collapsible sections whose chevron turns as they open. Each section opens on its own, so people can expand both.
Preview
Installation
FAQ
How do Products and Orders expand?
Each is a Collapsible. Its CollapsibleTrigger is a ghost button with the label and a chevron, and its CollapsibleContent holds the sub-items, indented with ms-4.
How does the chevron turn?
The trigger has aria-expanded while its section is open, and the chevron's group-aria-expanded:rotate-90 turns it to point down.
Which items are inside?
Products holds All Products, Categories and Inventory; Orders holds All Orders, Pending and Completed. Both start closed.
Can only one section be open at a time?
Not with separate Collapsibles. Use an Accordion instead if opening one section should close the other.
Related
- Left Drawer Navigation MenuA left drawer with a navigation menu of
- Simple Left DrawerA drawer that slides in from the left
- Multi-Level Nested AccordionAn accordion of help center topics where
- Left Drawer File ExplorerA left drawer with a file tree whose
- Nested Sidebar Items CollapsibleA two-level sidebar tree where
- Left Drawer with SearchA left drawer with a search field above