Overlays
Sheet
A side or bottom panel for focused work.
Usage
A sheet is a panel that slides in from an edge while the page stays in view behind it. It is built on the native <dialog> like Dialog, so the top layer, focus containment and an inert page come from the browser. The panel moves on the smooth spring (no overshoot) while the overlay fades.
When to use
- Focused secondary work that is longer than a dialog: settings, filters, a record’s details.
- Navigation on phones (a left sheet) and quick actions (a bottom sheet).
Not for: a short decision (use a dialog), a destructive confirmation (use an alert dialog), small contextual content (use a popover).
Sides and sizes
side picks the edge. size sets the width of a side sheet (320 / 400 / 520 / 640px, or full) and the maximum width of a top or bottom sheet.
Bottom sheet
A bottom sheet shows a grab handle. Drag it down to dismiss: past 35% of the height, or with a quick flick, it closes from where you let go; otherwise it springs back. Esc and the overlay still work.
API
Sheet
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | — | Controlled open state. |
| defaultOpen | boolean | false | Initial state when uncontrolled. |
| onOpenChange | (open: boolean) => void | — | Called when the sheet asks to open or close. |
SheetContent
| Prop | Type | Default | Description |
|---|---|---|---|
| side | 'right' | 'left' | 'top' | 'bottom' | 'right' | Edge the sheet slides in from. |
| size | 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'md' | Width of a side sheet: 320 / 400 / 520 / 640px or full. |
| dismissible | boolean | true | Close on Esc and on an overlay click. |
| showClose | boolean | true | The × button in the corner. |
| showHandle | boolean | true | Grab handle and drag-to-dismiss on a bottom sheet. |
| mobileFull | boolean | false | A left/right sheet fills the screen width below 640px. |
| panelClassName | string | — | Classes for the panel. className styles the overlay layer. |
SheetTrigger and SheetClose are buttons; pass asChild to use your own. SheetHeader, SheetTitle, SheetDescription, SheetBody (scrolls) and SheetFooter are layout parts.
Keyboard
| Key | Action |
|---|---|
| Esc | Closes the sheet (unless dismissible is false). |
| Tab | Moves focus to the next element inside the sheet. |
| Shift + Tab | Moves focus to the previous element inside the sheet. |
Accessibility
- Follows the WAI-ARIA modal dialog pattern; the page behind is inert.
- The title and description are wired to aria-labelledby / aria-describedby when present.
- Focus moves to the first [autofocus] field, otherwise the panel, and returns to the trigger on close.
- The grab handle is decorative. Dragging is an extra; Esc and the close controls always work.
- Page scroll is locked while open, without layout shift from the scrollbar.
Motion
- Open: the panel slides in on the smooth spring (about 540ms, no overshoot); the overlay fades in.
- Close: the panel slides out in 200ms; the sheet unmounts only after the animation ends.
- Drag: the panel follows the pointer one to one and the overlay fades with it.
- Reduced motion: it appears and disappears without movement.