ui-kit0.0

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.

Mobile navigation

On phones a left or right sheet can take the whole screen with mobileFull. This example is controlled so that choosing a link closes the 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

PropTypeDefaultDescription
openboolean—Controlled open state.
defaultOpenbooleanfalseInitial state when uncontrolled.
onOpenChange(open: boolean) => void—Called when the sheet asks to open or close.

SheetContent

PropTypeDefaultDescription
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.
dismissiblebooleantrueClose on Esc and on an overlay click.
showClosebooleantrueThe × button in the corner.
showHandlebooleantrueGrab handle and drag-to-dismiss on a bottom sheet.
mobileFullbooleanfalseA left/right sheet fills the screen width below 640px.
panelClassNamestring—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

KeyAction
EscCloses the sheet (unless dismissible is false).
TabMoves focus to the next element inside the sheet.
Shift + TabMoves 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.