shadcn.io is not affiliated with official shadcn/ui
Drawer examples · Bottom
Nested Bottom Drawers for React
A bottom drawer with a button that opens a second drawer on top of it.
Two levels of drawer: the parent holds a button that opens a second drawer above it. Closing the nested one brings people back to the parent, where they were. Use it for a short follow-up step, such as picking an option, without losing the first panel.
Preview
Installation
FAQ
How is the second drawer nested?
The nested Drawer, with its own trigger and content, sits inside the parent's DrawerContent. Opening it stacks the new panel above the parent.
How do people get back to the parent?
Close Nested is a DrawerClose inside the nested drawer, so it closes only that one. Escape and a swipe down also close the top drawer first.
The Button goes in the render prop of DrawerClose.
What happens to the parent while the nested drawer is open?
It stays open underneath. The parent dims its content and steps back behind the nested drawer, then comes forward again when it closes.
How deep should drawers nest?
One level is usually enough. Past two, people lose track of where they are; move the flow to a page instead.
Related
- Simple Bottom DrawerA bottom drawer with a title, a
- Standard DialogA share dialog with a read-only link, a
- Bottom Drawer with Snap PointsA bottom drawer that snaps to 148px
- Left Drawer with Nested ItemsA left drawer menu whose Products and
- Bottom Drawer with FormA bottom drawer with name, email and
- Simple Text PopoverA button that opens a popover with a