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>Stylesheet import
Section titled “Stylesheet import”Import the stylesheet once per app. If your bundler cannot handle CSS imports, use
scrollsheet/auto; see Styling.
Client-only
Section titled “Client-only”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.
The pieces
Section titled “The pieces”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.
Swipe down, tap outside, or press Esc. Only the two buttons close this sheet.
API referenceProps, styling hooks, and exports.