Skip to contentKino
Skip to Content

Sheet

A panel that slides in from any edge and is swiped back to it to close.

npx shadcn add https://kinoui.com/r/sheet.json
Share on

Examples

Default

It slides in from the end edge. Swipe or drag it back to close it: the faster it is let go, the faster it leaves.

Sides

Set side to start, top, bottom or end. Start and end follow the text direction.

Long content

Put what can grow in SheetBody. It scrolls, and the header and the footer stay in place.

Recede

With variant="recede", the page steps back behind the sheet: open it to see this page do it. Wrap the page in SheetIndent, once, around everything else.

Controlled

A sheet opened with the open prop needs no trigger. When it closes, focus goes back to what had it before.

Installation

npx shadcn@latest add https://kinoui.com/r/sheet.json
Files
lib/reduce-motion.tslib/resize.tslib/scroll.tslib/panel.tsxlib/popup.tslib/refs.tslib/swap.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxcomponents/kino/sheet.tsx
Packages
@base-ui/reactclass-variance-authority

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

Sheet

PropTypeDefaultDescription
side'start''top''bottom''end''end'The edge it slides in from and is swiped back to. Start and end follow the text direction.
variant'default''recede''default'recede steps the page in SheetIndent back behind it, and steps a sheet back behind one opened on top of it.
openbooleanNoneWhether it is open, when you hold the state.
onOpenChange(open, details) => voidNoneCalled when it opens or closes. A swipe has the reason swipe.

SheetContent

PropTypeDefaultDescription
showCloseButtonbooleantrueShows the close button in the top corner.
classNamestringNoneThe width of a sheet on a side: 26rem, and never closer than 3rem to the far edge, unless you set another.
containerHTMLElementShadowRootRefObjectdocument.bodyWhere it renders. Give that element contain: layout and overflow: clip, and the sheet treats it as the screen.

SheetBody

PropTypeDefaultDescription
classNamestringNoneGoes to its content, for padding and gaps.

CSS variables

VariableSet it onDefaultDescription
--sheet-recede-scaleSheetIndent, or <html>0.94How small the page gets behind a recede sheet.
--sheet-recede-offsetSheetIndent, or <html>0.75remHow far the page drops behind a recede sheet.

Accessibility

  • Focus moves into the sheet when it opens, Tab stays inside it, and Escape or a press outside closes it. Focus then goes back to the trigger.
  • Every sheet needs a SheetTitle, which names it for a screen reader. Give it sr-only to hide it.
  • A swipe is never the only way to close it: the close button, Escape and a press outside all close it too.
  • While the body scrolls it takes focus first, so the arrow keys scroll it, and a screen reader hears it as a region named by the title.
  • When the system asks for less motion, the sheet fades in and out where it stands, and the page doesn’t step back. A finger still drags it.