Installation
$ pnpm dlx shadcn@latest add @synccn/sheetFirst time in this project? Connect synccn with one command.
Usage
import { Sheet } from "@/components/ui/sheet";<Sheet open={open} onOpenChange={setOpen} side="right">…</Sheet>API reference
Generated from the component's TypeScript types, so it always matches the code.
Sheet
A panel that slides in from the edge of the screen. Bottom sheets get a drag handle.
PropTypeDescription
- openrequired
booleanWhether the sheet is shown.
- onOpenChangerequired
(open: boolean) => voidCalled when it should close.
- side
"left" | "right" | "bottom"Default
"right"Edge it slides in from.
- title
React.ReactNodeHeading.
- description
React.ReactNodeSupporting text.
- children
React.ReactNodeContent to render.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Keyboard
- TaborShift+TabMove focus; it stays inside while open
- EscClose
Accessibility
- role dialog with aria-modal; focus is trapped and page scroll is locked while open.
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA roles: dialog
- ARIA attributes: aria-label, aria-modal
- Keeps keyboard focus inside while open, and returns it when closed
- Closes with Escape
- Stops the page behind from scrolling while open
- Shows a visible focus ring for keyboard users
More overlays
DialogModal with focus trap, scroll lock and Escape to close.Dropdown MenuActions, checkboxes, labels and shortcuts with arrow-key navigation.Context MenuRight-click menu that also opens on long-press.PopoverFloating panel anchored to a trigger.TooltipLabel on hover and focus, on any side.CommandSearchable, grouped command list — the engine behind ⌘K.