bearnie

Sheet

A slide-out panel from the edge of the screen.

Installation

npx bearnie add sheet
npx bearnie add sheet

Usage

import {
  Sheet,
  SheetTrigger,
  SheetOverlay,
  SheetContent,
  SheetHeader,
  SheetTitle,
  SheetDescription,
  SheetFooter,
  SheetClose
} from "@/components/bearnie/sheet"
<Sheet>
  <SheetTrigger>Open</SheetTrigger>
  <SheetOverlay />
  <SheetContent>
    <SheetHeader>
      <SheetTitle>Sheet Title</SheetTitle>
      <SheetDescription>Sheet description goes here.</SheetDescription>
    </SheetHeader>
  </SheetContent>
</Sheet>

Examples

Mobile navigation

A left sheet is the classic mobile menu. Make the content a flex column so the footer pins to the bottom.

Shopping cart

A right sheet with a pinned summary and checkout button.

Side positions

Floating

floating detaches the panel from the screen edges with a margin, rounded corners, and a full border. Works with every side.

Without close button

Anatomy

  • Sheet - Root container that manages state
  • SheetTrigger - Button that opens the sheet
  • SheetOverlay - Background overlay
  • SheetContent - The sliding panel
  • SheetHeader - Header container
  • SheetTitle - Title text
  • SheetDescription - Description text
  • SheetFooter - Footer container
  • SheetClose - Layout-neutral wrapper; any element inside it closes the sheet on click

Props

SheetContent

Prop Type Default Description
side “top” | “right” | “bottom” | “left” “right” Edge of screen to slide from
floating boolean false Detach the panel from the edges with margins and rounded corners
showCloseButton boolean true Show the X close button
class string - Additional CSS classes