Skip to content

Sheet

A flyout that opens from the side of the screen, based on the dialog component.

API Reference

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.

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

Side sheets