Drawer
Side sheets for record detail and a draggable bottom drawer for mobile.
Playground
The wireframe shows where the sheet docks and how wide it gets; the button opens the real one. Sheets slide in from an edge and keep the page visible behind a light overlay.
Props
1import { Button } from "@/components/ui/button"2import {3 Sheet,4 SheetClose,5 SheetContent,6 SheetDescription,7 SheetFooter,8 SheetHeader,9 SheetTitle,10 SheetTrigger,11} from "@/components/ui/sheet"1213<Sheet>14 <SheetTrigger asChild>15 <Button variant="outline">Open filters</Button>16 </SheetTrigger>17 <SheetContent>18 <SheetHeader>19 <SheetTitle>Filters</SheetTitle>20 <SheetDescription>Narrow the deals list by stage.</SheetDescription>21 </SheetHeader>22 <fieldset className="grid gap-2.5 px-4">{/* checkboxes */}</fieldset>23 <SheetFooter className="flex-row justify-end border-t">24 <Button variant="ghost">Clear</Button>25 <SheetClose asChild>26 <Button>Apply filters</Button>27 </SheetClose>28 </SheetFooter>29 </SheetContent>30</Sheet>Sheet, drawer or modal
All three trap focus and dim the page. Pick by how much context people need and how they hold the device.
Sheet
Radix Dialog, docked to an edge
- Use for
- Record detail, filters and edit forms where the list behind stays useful for context.
- Avoid for
- Short confirmations. The panel is too heavy for a yes or no.
Drawer
vaul, draggable with snap points
- Use for
- Touch-first action lists and pickers on phones, where a thumb can reach the bottom edge.
- Avoid for
- Desktop layouts. A menu or a sheet fits pointer input better.
Modal
Radix Dialog, centered
- Use for
- Blocking decisions and short focused tasks that must be finished or cancelled first.
- Avoid for
- Long forms or anything people need to compare with the page behind.
States
States of the trigger. Once open, the panel follows the Modal states: submitting locks the footer, errors stay inline.
- Default
rest - Hover
:hover - Focus
:focus-visible - Loading
aria-busy - Disabled
disabled - Error
aria-invalid - Success
data-state=success
Examples
A record-detail sheet opened from a list, with properties, tabs and footer actions, and a vaul drawer for touch with a peek and a full snap point.
Globex
Enterprise rollout
Opens at a 45% peek. Drag up, or use the chevron, to snap to full height.
Keyboard
- Move within the panel, focus is trapped
- Tab
- Close and return focus to the trigger
- Esc
- Open from the row or button
- EnterorSpace
Semantics and ARIA
- Both render a
dialogwitharia-modal, named by the title and described by the description. The page behind is hidden from assistive tech. - Rows that open a sheet are real buttons with
aria-haspopup="dialog", so focus returns to the exact row on close. - Dragging is never the only way: the drawer has a Done button and an expand button with an
aria-label, and Esc closes it. - Actions in the drawer are at least 44px tall for touch. Destructive ones are last and confirmed before they run.
- Blocking overlay dismissal is for unsaved work only. Esc and the close button still work, so nobody gets stuck.