Sheet
Extends the Dialog component to display content that complements the main screen. Slides in from the edge of the viewport.
Preview
Installation
Use the CLI to add this component to your project.
Usage
tsx
41 linesCopy
Side Variants
Use the side prop to control which edge of the screen the sheet slides in from.
Right (Default)
Left
Top
Bottom
components/ui/sheet.tsx
2 linesDownload Copy
Props
| Prop | Type | Default | Description |
|---|---|---|---|
side | 'top' | 'right' | 'bottom' | 'left' | right | The edge of the screen the sheet slides in from |
open | boolean | undefined | Controlled open state of the sheet |
onOpenChange | (open: boolean) => void | undefined | Callback when the open state changes |
modal | boolean | true | Whether to render the sheet in a portal with overlay |
Sub-components
Sheet
The root component that manages sheet state.
SheetTrigger
The button that opens the sheet. Use asChild to render your own button.
SheetContent
Contains the content that is displayed when the sheet is open. Accepts side prop.
SheetHeader
Contains the title and description of the sheet.
SheetTitle
The title of the sheet.
SheetDescription
The description of the sheet.
SheetFooter
Contains the footer content, typically action buttons.
SheetClose
A button that closes the sheet. Use asChild to render your own button.