Sheet

Extends the Dialog to display content that complements the main content of the screen.

Installation

pnpm dlx cubix@latest add sheet --base aria

Usage

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

Composition

Use the following composition to build a Sheet:

 
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.

API Reference

Sheet is built on the Dialog primitive. See also the Base UI Dialog documentation for additional props.

Sheet

PropTypeDefaultDescription
openboolean-Controlled open state. Omit to use uncontrolled mode.
defaultOpenbooleanfalseInitial open state when uncontrolled.
onOpenChange(open: boolean) => void-Called when the open state changes.
childrenReact.ReactNode-The trigger and sheet content.

SheetTrigger

PropTypeDefaultDescription
renderReact.ReactElement-Compose the trigger onto a child element such as Button (Base UI).
asChildboolean-Compose the trigger onto a child element such as Button (Radix UI).
childrenReact.ReactNode-The trigger content.

SheetContent

PropTypeDefaultDescription
side"top" | "right" | "bottom" | "left""right"Edge of the screen where the sheet appears.
showCloseButtonbooleantrueWhether to show the close button in the top-right corner.
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).
childrenReact.ReactNode-Header, body, and footer content of the sheet.

SheetHeader / SheetFooter

PropTypeDefaultDescription
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).
childrenReact.ReactNode-Content for the header or footer region.

SheetTitle / SheetDescription

PropTypeDefaultDescription
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).
childrenReact.ReactNode-Accessible title or description text.