shadcn.io is not affiliated with official shadcn/ui
Drawer examples · Bottom
Bottom Drawer with Snap Points for React
A bottom drawer that snaps to 148px, 355px or the full screen height as it's dragged.
A bottom drawer with three resting heights. snapPoints lists them, 148px for a peek, 355px for half the screen and 1 for the full height, and the drawer settles on the nearest one when people let go. Use it for maps, players and lists people glance at before opening fully.
Preview
Installation
FAQ
How are the snap points set?
snapPoints on Drawer takes ["148px", "355px", 1]. A string with a unit is a height; a number from 0 to 1 is a fraction of the screen, so 1 is the full height.
Which snap point does it open at?
The first one, 148px.
Set defaultSnapPoint on Drawer to open at another, or control it with snapPoint.
How do people move between snap points?
By dragging the bar or the panel. On release the drawer settles on a point. Swiping down from the lowest point closes it.
What happens to content that doesn't fit?
At a low snap point the rest of the drawer sits below the screen edge. Put the most useful part at the top, and let the body scroll once the drawer is fully open.
Related
- Simple Bottom DrawerA bottom drawer with a title, a
- Scrollable Bottom DrawerA bottom drawer with terms and conditions
- Bottom Drawer with FormA bottom drawer with name, email and
- Bottom-Sliding SheetA sheet that slides up from the bottom of
- Simple Left DrawerA drawer that slides in from the left
- Bottom Drawer Event DetailsA bottom drawer with an event's badges