Sheet
A panel that slides in from the edge for a task that needs more room than a dialog.
Installation
npm i @uisatin/uiimport { Sheet } from '@uisatin/ui/sheet'About 28.4 kB of JavaScript, minified and gzipped, with what it imports (React aside). The stylesheet is one file for every component.
npx shadcn@latest add https://uisatin.dev/r/sheet.json https://uisatin.dev/r/input.jsonAdds sheet.tsx, alert.tsx, button.tsx, dialog.tsx, form-field.tsx, input.tsx, labels.tsx and spinner.tsx to components/ui and installs radix-ui.
First time with Satin? Set it up once, styles and fonts included, with the installation guide.
API Reference
The Sheet component wraps the Radix dialog in a div with role="dialog" that slides in from the right, the left or the bottom. Wrap footer buttons in SheetClose to close it.
| Prop | Type | Default |
|---|---|---|
side | "right""left""bottom" | "right" |
trigger | ReactNode | — |
title | ReactNode | — |
description | ReactNode | — |
children | ReactNode | — |
footer | ReactNode | — |
open | boolean | — |
defaultOpen | boolean | false |
onOpenChange | (open: boolean) => void | — |
modal | boolean | true |
className | string | — |
ref | Ref<HTMLElement> | — |
...props | ComponentProps<typeof Dialog.Content>Other attributes go to the Radix Dialog.Content part | — |
Accessibility
A Radix dialog that slides in from an edge: role="dialog" labelled by title and described by description. The title is required. Opening it moves focus in; while modal (the default) the rest of the page is hidden from screen readers and can’t be reached; closing returns focus to the trigger. The close button and the bottom sheet’s handle are both buttons named "Close".
| Key | Action |
|---|---|
| TaborShift+Tab | Moves focus through the sheet, staying inside it while it is modal. |
| Esc | Closes the sheet and returns focus to the trigger. |
Something wrong or missing on this page?
Report a problemSuggest an improvement