Sheet
A panel that slides in from any edge of the screen. Good for forms, filters and navigation on small screens. The close button is 44px.
Installation
npx shadcn@latest add @sevenone/sheetUsage
import {
Sheet,
SheetClose,
SheetContent,
SheetDescription,
SheetFooter,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet"Examples
Edit profile
<Sheet>
<SheetTrigger asChild>
<Button variant="outline">Open</Button>
</SheetTrigger>
<SheetContent>
<SheetHeader>
<SheetTitle>Edit profile</SheetTitle>
<SheetDescription>Make changes to your profile here.</SheetDescription>
</SheetHeader>
<div className="grid gap-6 px-4">…</div>
<SheetFooter>
<Button type="submit">Save changes</Button>
<SheetClose asChild>
<Button variant="outline">Cancel</Button>
</SheetClose>
</SheetFooter>
</SheetContent>
</Sheet>Side
Use side to open the sheet from the top, right, bottom or left.
<SheetContent side="left">…</SheetContent>Accessibility
- Focus stays inside the sheet until it closes, and Esc closes it.
- Always give it a SheetTitle; screen readers announce it.
- The slide animation turns off when people ask their system for reduced motion.