View fulldotdev/ui on GitHub

Sheet

A sliding panel component that appears from the edge of the screen.

Installation

npx shadcn@latest add @fulldev/sheet

Usage

import {
  Sheet,
  SheetClose,
  SheetContent,
  SheetDescription,
  SheetFooter,
  SheetHeader,
  SheetTitle,
  SheetTrigger,
} from "@/components/ui/sheet"
<Sheet>
  <SheetTrigger variant="outline">Open</SheetTrigger>
  <SheetContent>
    <SheetHeader>
      <SheetTitle>Are you absolutely sure?</SheetTitle>
      <SheetDescription>This action cannot be undone.</SheetDescription>
    </SheetHeader>
  </SheetContent>
</Sheet>

SheetTrigger and SheetClose render a Button and take its variant and size props. The sheet uses the Data Slot dialog: it traps focus, closes on Escape and outside click, and locks page scroll while open.

Composition

Sheet
├── SheetTrigger
└── SheetContent
    ├── SheetHeader
    │   ├── SheetTitle
    │   └── SheetDescription
    └── SheetFooter

Side

Use the side prop on SheetContent to set the edge of the screen where the sheet appears. Values are top, right, bottom, or left.

No Close Button

Use showCloseButton={false} on SheetContent to hide the close button.

RTL

API Reference

Source: src/components/ui/sheet

Sheet

PropTypeDefault
defaultOpenbooleanfalse
closeOnClickOutsidebooleantrue
closeOnEscapebooleantrue
lockScrollbooleantrue

SheetContent

PropTypeDefault
side"top" | "right" | "bottom" | "left""right"
showCloseButtonbooleantrue

See the Data Slot dialog docs for events and programmatic control.