Shadcn.io is not affiliated with official shadcn/ui
Shadcn Drawer
React drawer for mobile sheets and side panels. Built with TypeScript and Tailwind CSS for Next.js using Base UI — swipe to dismiss, four sides, snap points.
The shadcn drawer is a panel that slides in from an edge. Drag the handle, swipe it closed, or tap the overlay. Use it for mobile action sheets, filters, and short forms that should not cover the whole viewport.
Looking for a neobrutalism version for shadcn?
Same drawer, thicker borders. The NeoBrutalism drawer is the kit if you want that look.
Usage
import {
Drawer,
DrawerClose,
DrawerContent,
DrawerDescription,
DrawerFooter,
DrawerHeader,
DrawerTitle,
DrawerTrigger,
} from "@/components/ui/drawer"<Drawer>
<DrawerTrigger>Open</DrawerTrigger>
<DrawerContent>
<DrawerHeader>
<DrawerTitle>Edit profile</DrawerTitle>
<DrawerDescription>This action cannot be undone.</DrawerDescription>
</DrawerHeader>
<DrawerFooter>
<Button>Submit</Button>
<DrawerClose>
<Button variant="outline">Cancel</Button>
</DrawerClose>
</DrawerFooter>
</DrawerContent>
</Drawer>direction is top, right, bottom, or left. Default is bottom — that is the only side that shows the grab handle.
Composition
Scrollable Content
Keep the header and footer pinned. Put overflow-y-auto on the middle region, not on DrawerContent.
Sides
direction on Drawer. Bottom and top cap at 50vh here so the page behind still shows.
Responsive Dialog
Same form, two shells. Dialog from md up, drawer on small screens. Share open so the trigger does not remount.
Nested
A drawer opening another drawer. Dismiss the inner one first.
Non-modal
The page stays interactive. Use it when they still need the content behind.
Snap Points
Stop at 30%, 50%, 90%. They drag between stops.
Swipe Handle
A visible grabber at the top. Mobile expects it.
RTL
Wrap with DirectionProvider and dir="rtl". Copy, numbers, and the chart axis follow the reading direction.
API
Prop
Type
DrawerTrigger
Prop
Type
DrawerClose takes render the same way. DrawerTitle is announced when the panel opens.
Keyboard
| Key | Action |
|---|---|
Space / Enter | Open from the trigger, or fire the focused button |
Escape | Close and return focus to the trigger |
Tab / Shift + Tab | Cycle controls inside the drawer |
Swipe the handle or the overlay to dismiss. dismissible={false} turns both the swipe and Escape off.
Notes
Scroll the inner region
overflow-y-auto on DrawerContent steals the drag gesture. Scroll a child. Leave the header and footer outside that scroller so actions stay on screen.
On a laptop, pair this with a Dialog. A bottom sheet on a wide viewport is a small strip of form.
With other components
Trigger and footer actions
DialogDesktop at the md breakpoint
FormFields inside the panel
InputEmail, username
LabelName the fields
Scroll AreaLong lists inside
Questions
Related
Was this page helpful?
Sign in to leave feedback.
Direction
React direction provider for Arabic, Hebrew, and Persian pages. Built with TypeScript and Tailwind CSS for Next.js using Base UI — one context so menus and sliders flip.
Dropdown Menu
React dropdown menu for actions, account menus, and settings. Built with TypeScript and Tailwind CSS for Next.js using Base UI — groups, shortcuts, and nested submenus.