shadcn.io is not affiliated with official shadcn/ui
Drawer examples · Bottom
Simple Bottom Drawer for React
A bottom drawer with a title, a description, a short body and Submit and Cancel buttons.
The basic drawer: it slides up from the bottom with a drag bar, a header, a short body and a footer with Submit and Cancel. People close it by swiping down, pressing Escape, clicking the overlay or pressing Cancel. Start from this one and swap in your content.
Preview
Installation
FAQ
Why does it open from the bottom?
Bottom is the default, so Drawer sets no direction. It slides up from the bottom edge, and a downward swipe closes it.
Set swipeDirection on Drawer to up, left or right for the other edges; it names the swipe that closes the drawer.
What's inside the drawer?
DrawerHeader with the title Drawer Title and a description, a paragraph of muted text, and DrawerFooter with Submit and Cancel stacked full width.
How does Cancel close it?
Cancel is a DrawerClose, so pressing it dismisses the drawer. Submit is a plain Button with no handler.
The Button goes in the render prop of DrawerClose.
Is there a drag bar?
Yes, a bar at the top edge shows the drawer can be dragged.
showSwipeHandle on Drawer turns it on.
Related
- Bottom Drawer with FormA bottom drawer with name, email and
- Simple Left DrawerA drawer that slides in from the left
- Bottom Drawer with Snap PointsA bottom drawer that snaps to 148px
- Bottom-Sliding SheetA sheet that slides up from the bottom of
- Standard DialogA share dialog with a read-only link, a
- Simple Text PopoverA button that opens a popover with a