Skip to content

Anatomy

import { Sheet } from 'scrollsheet';
import 'scrollsheet/styles.css';
<Sheet.Root>
<Sheet.Trigger>Open</Sheet.Trigger>
<Sheet.Content>
<Sheet.Handle />
<Sheet.Title>Title</Sheet.Title>
<Sheet.Description>Description</Sheet.Description>
<Sheet.Close>Done</Sheet.Close>
</Sheet.Content>
</Sheet.Root>

Import the stylesheet once per app. If your bundler cannot handle CSS imports, use scrollsheet/auto; see Styling.

Sheet.* requires client-side state, event handlers, and DOM access. In Next.js App Router, add 'use client' to the file that renders it. See Framework support.

Sheet.Root owns state and renders nothing itself. Sheet.Trigger opens it on click; skip it and drive open/onOpenChange yourself for a fully controlled sheet. Sheet.Content is the <dialog>, backdrop, scroll track, and panel together. The remaining components are optional: Sheet.Handle, Sheet.Footer, Sheet.Title, Sheet.Description, and Sheet.Close. See Other exports.

Non-dismissible confirm

Full source on GitHub ↗

Swipe down, tap outside, or press Esc. Only the two buttons close this sheet.