Sheet
A side or bottom panel on Base UI Dialog, with a grabber on phones.
For detail or a longer task beside the page. On phones a left or right sheet takes the full width, and a bottom sheet gets rounded top corners and a grabber; the grabber is decoration and does not drag.
Default
import { Button } from "@/components/ui/button"
import {
Sheet,
SheetClose,
SheetContent,
SheetDescription,
SheetFooter,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet"
const details = [
["Status", "Sent"],
["Issued", "4 November 2026"],
["Due", "4 December 2026"],
["Amount", "€2,480.00"],
]
export default function SheetDefault() {
return (
<Sheet>
<SheetTrigger render={<Button variant="outline" />}>Open invoice 1042</SheetTrigger>
<SheetContent>
<SheetHeader>
<SheetTitle>Invoice 1042</SheetTitle>
<SheetDescription>Website refresh, second milestone.</SheetDescription>
</SheetHeader>
<dl className="grid grid-cols-[auto_1fr] gap-x-6 gap-y-2 px-6">
{details.map(([term, value]) => (
<div key={term} className="contents">
<dt className="text-muted-foreground">{term}</dt>
<dd className="tabular-nums">{value}</dd>
</div>
))}
</dl>
<SheetFooter>
<SheetClose render={<Button />}>Send a reminder</SheetClose>
<SheetClose render={<Button variant="outline" />}>Close</SheetClose>
</SheetFooter>
</SheetContent>
</Sheet>
)
}
Sides
import { Button } from "@/components/ui/button"
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger } from "@/components/ui/sheet"
const sides = [
{ side: "top", label: "Top" },
{ side: "right", label: "Right" },
{ side: "bottom", label: "Bottom" },
{ side: "left", label: "Left" },
] as const
export default function SheetSides() {
return (
<div className="flex flex-wrap items-center justify-center gap-2">
{sides.map(({ side, label }) => (
<Sheet key={side}>
<SheetTrigger render={<Button variant="outline" />}>{label}</SheetTrigger>
<SheetContent side={side}>
<SheetHeader>
<SheetTitle>Filters</SheetTitle>
<SheetDescription>This sheet opens from the {side} edge of the screen.</SheetDescription>
</SheetHeader>
</SheetContent>
</Sheet>
))}
</div>
)
}
Without the close button
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 SheetWithoutTheCloseButton() {
return (
<Sheet>
<SheetTrigger render={<Button variant="outline" />}>Edit task</SheetTrigger>
<SheetContent showCloseButton={false}>
<SheetHeader>
<SheetTitle>Edit task</SheetTitle>
<SheetDescription>Changes are saved when you choose Save.</SheetDescription>
</SheetHeader>
<div className="flex flex-col gap-4 px-6">
<Field>
<FieldLabel htmlFor="edit-task-title">Title</FieldLabel>
<Input id="edit-task-title" defaultValue="Review the pricing page copy" autoComplete="off" />
</Field>
<Field>
<FieldLabel htmlFor="edit-task-due">Due</FieldLabel>
<Input id="edit-task-due" type="date" defaultValue="2026-11-27" />
</Field>
</div>
<SheetFooter>
<SheetClose render={<Button />}>Save</SheetClose>
<SheetClose render={<Button variant="outline" />}>Cancel</SheetClose>
</SheetFooter>
</SheetContent>
</Sheet>
)
}
Installation
npx shadcn@latest add @khaeli/sheetbunx --bun shadcn@latest add @khaeli/sheetInstall @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.
Installs with
- Registry items
- npm packages
- @base-ui/react ^1.7.0
- @keyline-icons/react ^2.2.0
Keyboard
EnterSpace- On the trigger, opens the sheet. Focus moves to the first control inside it.
TabShift Tab- Move through the controls inside the sheet and wrap at either end. The close button in the corner comes last. Focus cannot leave the sheet while it is open.
Escape- Closes the sheet and returns focus to the trigger. A click on the dimmed page does the same.
Accessible name
- The sheet is a dialog: it is named by
SheetTitleand described bySheetDescription. Always render a title. - The close button in the corner is named Close by the item.
showCloseButton={false}removes it, so keep aSheetClosein the footer. SheetTriggerandSheetClosetake your button throughrender; the name is the button's text.
Registry JSON
The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/sheet.json