Demos

A sheet that slides in from the right.

Usage

Use a sheet for a task or detail that needs more room than a dialog but should keep the page in view: a filter panel, a note form, record details. Right is the usual side. Use bottom for short actions on mobile.

Import it from @workspace/ui/components/sheet.

Anatomy

  • Sheet — Holds the open state.
  • SheetTrigger — Opens the sheet. Pass a button through render.
  • SheetContent — The panel, with backdrop and a close button. side sets the edge.
  • SheetHeader — Holds the title and description.
  • SheetTitle — Names the sheet for screen readers. Always include it.
  • SheetDescription — Supporting text.
  • SheetFooter — Actions, pinned to the bottom.
  • SheetClose — Closes the sheet. Pass a button through render.

Notes

  • The sheet is a modal. Focus is trapped inside until it closes.
  • Left and right sheets take three quarters of the width on small screens.

Examples

Side

Set side on SheetContent to open from any edge.

Without close button

Set showCloseButton={false} and give the reader explicit actions instead.

Props

These are the props you set most often. Unlisted props pass through to the underlying element.

Sheet

PropTypeDefaultDescription
defaultOpenbooleanfalseOpen on first render.
openboolean—Open state when controlled.
onOpenChange(open) => void—Called when the sheet opens or closes.

SheetContent

PropTypeDefaultDescription
side"top", "right", "bottom", or "left"rightEdge the sheet slides from.
showCloseButtonbooleantrueShow the X button in the corner.
classNamestring—Classes merged onto the panel.