- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Checkbox Group
- Collapsible
- Combobox
- Command
- Context Menu
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Fieldset
- Form
- Frame
- Group
- Input
- Input Group
- Kbd
- Label
- Menu
- Menubar
- Message
- Meter
- Number Field
- OTP Field
- Pagination
- Popover
- Preview Card
- Progress
- Questionnaire
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Toolbar
- Tooltip
- Artifact
- Audio Player
- Canvas
- Chain of Thought
- Checkpoint
- Code Block
- Commit
- Connection
- Context
- Controls
- Edge
- Environment Variables
- Mic Selector
- Model Selector
- Node
- Node Toolbar
- Open in Chat
- Panel
- Plan
- Prompt Input
- Queue
- Reasoning
- Sandbox
- Schema Display
- Shimmer
- Snippet
- Sources
- Speech Input
- Stack Trace
- Suggestion
- Tool
- Transcription
- Web Preview
Sheet
A flyout that opens from the side of the screen, based on the dialog component.
import { Button } from "@/components/ui/button";
import { Field, FieldLabel } from "@/components/ui/field";
import { Input } from "@/components/ui/input";
import {
Sheet,
SheetClose,
SheetContent,
SheetDescription,
SheetFooter,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet";
export default function Particle() {
return (
<Sheet>
<SheetTrigger render={<Button variant="outline" />}>Open Sheet</SheetTrigger>
<SheetContent>
<SheetHeader>
<SheetTitle>Edit profile</SheetTitle>
<SheetDescription>
Make changes to your profile here. Click save when you're done.
</SheetDescription>
</SheetHeader>
<form className="contents">
<div className="grid gap-4">
<Field>
<FieldLabel>Name</FieldLabel>
<Input defaultValue="Margaret Welsh" type="text" />
</Field>
<Field>
<FieldLabel>Username</FieldLabel>
<Input defaultValue="@maggie.welsh" type="text" />
</Field>
</div>
<SheetFooter>
<SheetClose render={<Button variant="ghost" />}>Cancel</SheetClose>
<Button type="submit">Save</Button>
</SheetFooter>
</form>
</SheetContent>
</Sheet>
);
}
Installation
pnpm dlx shadcn@latest add @frontal-labs/sheet
Usage
import {
Sheet,
SheetClose,
SheetContent,
SheetDescription,
SheetFooter,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet";<Sheet>
<SheetTrigger>Open</SheetTrigger>
<SheetContent>
<SheetHeader>
<SheetTitle>Are you absolutely sure?</SheetTitle>
<SheetDescription>
This action cannot be undone. This will permanently delete your account and remove your data
from our servers.
</SheetDescription>
</SheetHeader>
<div>Content</div>
<SheetFooter>
<SheetClose>Close</SheetClose>
</SheetFooter>
</SheetContent>
</Sheet>API Reference
Sheet
Root component. Alias for Dialog.Root from Base UI.
SheetTrigger
Trigger button that opens the sheet. Alias for Dialog.Trigger from Base UI.
SheetContent
Popup container that displays the sheet content. Renders the portal and the overlay internally, so SheetPortal and SheetOverlay do not need to be composed by hand.
| Prop | Type | Default | Description |
|---|---|---|---|
side | "right" | "left" | "top" | "bottom" | "right" | Controls which side of the screen the sheet opens from |
showCloseButton | boolean | true | When true, displays a close button in the top-right corner |
dark | boolean | true | Renders the surface with the dark palette by applying .dark to the portal element |
All other props from Dialog.Popup are supported.
Example:
// Right side sheet (default)
<SheetContent side="right">
...
</SheetContent>
// Left side sheet
<SheetContent side="left">
...
</SheetContent>
// Top sheet
<SheetContent side="top">
...
</SheetContent>
// Bottom sheet
<SheetContent side="bottom">
...
</SheetContent>The dark prop
The sheet renders with the dark palette by default. Pass dark={false} when it should follow the ambient theme instead — next-themes sets dark on <html> and the portal lands in document.body, inside it, so the surface can pick up the ambient theme once dark is turned off.
If the sheet is opened from a .dark region scoped mid-page, which a portal does escape, rendering into the scoped node keeps inheritance intact in both directions without needing this prop at all.
<SheetContent dark>...</SheetContent>SheetHeader
Container for the sheet title and description.
SheetFooter
Footer section for action buttons. Pushes itself to the bottom of the sheet.
SheetTitle
Title component. Alias for Dialog.Title from Base UI.
SheetDescription
Description component. Alias for Dialog.Description from Base UI.
SheetClose
Close button component. Alias for Dialog.Close from Base UI.
SheetPortal
Portal component for rendering outside the DOM hierarchy. Alias for Dialog.Portal from Base UI. Rendered internally by SheetContent.
SheetOverlay
Backdrop component. Styled wrapper for Dialog.Backdrop from Base UI. Rendered internally by SheetContent.
Examples
Sheet with a Form
import { Button } from "@/components/ui/button";
import { Field, FieldLabel } from "@/components/ui/field";
import { Input } from "@/components/ui/input";
import {
Sheet,
SheetClose,
SheetContent,
SheetDescription,
SheetFooter,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet";
export default function Particle() {
return (
<Sheet>
<SheetTrigger render={<Button variant="outline" />}>Open Sheet</SheetTrigger>
<SheetContent>
<SheetHeader>
<SheetTitle>Edit profile</SheetTitle>
<SheetDescription>
Make changes to your profile here. Click save when you're done.
</SheetDescription>
</SheetHeader>
<form className="contents">
<div className="grid gap-4">
<Field>
<FieldLabel>Name</FieldLabel>
<Input defaultValue="Margaret Welsh" type="text" />
</Field>
<Field>
<FieldLabel>Username</FieldLabel>
<Input defaultValue="@maggie.welsh" type="text" />
</Field>
</div>
<SheetFooter>
<SheetClose render={<Button variant="ghost" />}>Cancel</SheetClose>
<Button type="submit">Save</Button>
</SheetFooter>
</form>
</SheetContent>
</Sheet>
);
}
Side sheets
import { Button } from "@/components/ui/button";
import {
Sheet,
SheetContent,
SheetDescription,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet";
export default function Particle() {
return (
<div className="flex flex-wrap gap-2">
<Sheet>
<SheetTrigger render={<Button variant="outline" />}>Open Right</SheetTrigger>
<SheetContent showCloseButton={false}>
<SheetHeader>
<SheetTitle>Right</SheetTitle>
<SheetDescription>Right side of the screen.</SheetDescription>
</SheetHeader>
<div>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
</p>
</div>
</SheetContent>
</Sheet>
<Sheet>
<SheetTrigger render={<Button variant="outline" />}>Open Left</SheetTrigger>
<SheetContent showCloseButton={false} side="left">
<SheetHeader>
<SheetTitle>Left</SheetTitle>
<SheetDescription>Left side of the screen.</SheetDescription>
</SheetHeader>
<div>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
</p>
</div>
</SheetContent>
</Sheet>
<Sheet>
<SheetTrigger render={<Button variant="outline" />}>Open Top</SheetTrigger>
<SheetContent showCloseButton={false} side="top">
<SheetHeader>
<SheetTitle>Top</SheetTitle>
<SheetDescription>Top of the screen.</SheetDescription>
</SheetHeader>
<div>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
</p>
</div>
</SheetContent>
</Sheet>
<Sheet>
<SheetTrigger render={<Button variant="outline" />}>Open Bottom</SheetTrigger>
<SheetContent showCloseButton={false} side="bottom">
<SheetHeader>
<SheetTitle>Bottom</SheetTitle>
<SheetDescription>Bottom of the screen.</SheetDescription>
</SheetHeader>
<div>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
</p>
</div>
</SheetContent>
</Sheet>
</div>
);
}