Skip to content

Sheet

A side or bottom panel on Base UI Dialog, with a grabber on phones.

For detail or a longer task beside the page. On phones a left or right sheet takes the full width, and a bottom sheet gets rounded top corners and a grabber; the grabber is decoration and does not drag.

Default

Sides

Without the close button

Installation

npx shadcn@latest add @khaeli/sheet

Install @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.

Installs with

npm packages
  • @base-ui/react ^1.7.0
  • @keyline-icons/react ^2.2.0

Keyboard

EnterSpace
On the trigger, opens the sheet. Focus moves to the first control inside it.
TabShift Tab
Move through the controls inside the sheet and wrap at either end. The close button in the corner comes last. Focus cannot leave the sheet while it is open.
Escape
Closes the sheet and returns focus to the trigger. A click on the dimmed page does the same.

Accessible name

  • The sheet is a dialog: it is named by SheetTitle and described by SheetDescription. Always render a title.
  • The close button in the corner is named Close by the item. showCloseButton={false} removes it, so keep a SheetClose in the footer.
  • SheetTrigger and SheetClose take your button through render; the name is the button's text.

Registry JSON

The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/sheet.json