Command Palette

Search for a command to run...

Sheet

Displays a dialog that slides in from the edge of the screen.

A sheet component built on top of Radix UI Dialog.

Installation

npx shadcn@latest add sheet

Usage

import {
Sheet,
SheetContent,
SheetDescription,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet"
<Sheet>
<SheetTrigger>Open</SheetTrigger>
<SheetContent>
<SheetHeader>
<SheetTitle>Are you sure absolutely sure?</SheetTitle>
<SheetDescription>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</SheetDescription>
</SheetHeader>
</SheetContent>
</Sheet>

Examples

Side

Use the side property to specify the side from which the sheet appears.

<Sheet>
<SheetTrigger>Open</SheetTrigger>
<SheetContent side="right">
<SheetHeader>
<SheetTitle>Edit profile</SheetTitle>
<SheetDescription>
Make changes to your profile here. Click save when you're done.
</SheetDescription>
</SheetHeader>
<div className="grid gap-4 py-4">
<div className="grid grid-cols-4 items-center gap-4">
<Label htmlFor="name" className="text-right">
Name
</Label>
<Input id="name" className="col-span-3" />
</div>
<div className="grid grid-cols-4 items-center gap-4">
<Label htmlFor="username" className="text-right">
Username
</Label>
<Input id="username" className="col-span-3" />
</div>
</div>
<SheetFooter>
<SheetClose asChild>
<Button type="submit">Save changes</Button>
</SheetClose>
</SheetFooter>
</SheetContent>
</Sheet>

Props

Sheet

Extends React.ComponentProps<typeof Dialog>

SheetTrigger

Extends React.ComponentProps<typeof DialogTrigger>

SheetContent

Extends React.ComponentProps<typeof DialogContent>

| Prop | Type | Default | Description | | :-- | :-- | :-- | :-- | | side | "top" \| "right" \| "bottom" \| "left" | "right" | The side from which the sheet appears. |

SheetHeader

Extends React.ComponentProps<"div">

SheetFooter

Extends React.ComponentProps<"div">

SheetTitle

Extends React.ComponentProps<typeof DialogTitle>

SheetDescription

Extends React.ComponentProps<typeof DialogDescription>