Skip to main content
Sheet component preview (light)
  • Location: sabo/src/components/ui/sheet.tsx

When to use

  • Secondary surfaces for settings, filters, or context details.
  • Use right/left edges for app side panels; top/bottom for mobile drawers.

Usage

sabo/src/components/ui/sheet.tsx
import {
  Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription, SheetFooter
} from "@/components/ui/sheet";
import { Button } from "@/components/ui/button";

export function Example() {
  return (
    <Sheet>
      <SheetTrigger asChild><Button>Open sheet</Button></SheetTrigger>
      <SheetContent side="right">
        <SheetHeader>
          <SheetTitle>Account</SheetTitle>
          <SheetDescription>Make changes to your profile here.</SheetDescription>
        </SheetHeader>
        {/* body */}
        <SheetFooter>
          <Button variant="outline">Cancel</Button>
          <Button>Save</Button>
        </SheetFooter>
      </SheetContent>
    </Sheet>
  );
}

Key props

SheetContent.side
string
default:"right"
top | right | bottom | left
SheetContent.closeIconSize
string
default:"size-4"
Controls the close icon size utility.
This component forwards all props from Radix Dialog primitives (Root/Trigger/Content, etc.). Above are commonly used props. For the full API, see Radix docs: https://www.radix-ui.com/primitives/docs/components/dialog

Styling tip

  • Right/left sheets have fixed widths; use sm:max-w-sm overrides for custom sizes.
  • Keep body content scrollable and put actions in SheetFooter.

Accessibility

  • Uses dialog semantics with overlay and focus trapping.