Sheet
A panel pinned to one edge of the screen, for filters, details and forms that should not take you off the page.
Installation
pnpm dlx nachui add sheetAnatomy
A sheet is flush with the edge it opens from and fills that edge end to end. It traps focus, closes on Escape and on the backdrop, locks page scroll and returns focus to the trigger when it goes.
Sheet or Drawer
They look related and they are, but they answer different questions. Drawer is the touch one: a floating island with a handle you drag to dismiss, at home on a phone. Sheet is the desktop one: a fixed side panel with no drag, sized in steps, meant for a filter rail, an edit form or a details view. If the content is something you fill in, reach for Sheet. If it is something you flick away, reach for Drawer.
Composition
Use the following composition to build a
Sheet:Header, Body and Footer are layout: the body scrolls on its own and the footer sticks to the bottom, so long forms keep their actions in reach.Sides
Sizes
size is a width on the left and right, and a maximum height on the top and bottom. full covers the screen.API Reference
Sheet
| Prop | Type | Default | Description |
|---|---|---|---|
defaultOpen | boolean | false | Open state when uncontrolled |
open | boolean | - | Controlled open state |
onOpenChange | (open: boolean) => void | - | Called when the open state changes |
Sheet.Trigger
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Render the child as the trigger instead of a button |
className | string | - | Additional CSS classes |
Sheet.Content
| Prop | Type | Default | Description |
|---|---|---|---|
side | 'top' | 'bottom' | 'left' | 'right' | 'right' | Edge the sheet is pinned to |
size | 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'md' | Width on the sides, height top and bottom |
showClose | boolean | true | Show the corner close button |
closeLabel | string | 'Close' | Accessible name of that button |
className | string | - | Additional CSS classes |
Sheet.Close
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Render the child as the closer instead of a button |
className | string | - | Additional CSS classes |
Sheet.Header / Sheet.Body / Sheet.Footer / Sheet.Title / Sheet.Description
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Additional CSS classes |
Found something to improve?
Notice a bug, typo, or missing detail on this page? Help us make the documentation better by opening a GitHub issue.