Copy to clipboard
Edit profile
Make changes to your profile here. Click save when you’re done.
Installation
Copy to clipboard
npx bearnie add sheet
npx bearnie add sheet
bunx bearnie add sheet
bunx bearnie add sheet
pnpm dlx bearnie add sheet
pnpm dlx bearnie add sheet
yarn dlx bearnie add sheet
yarn dlx bearnie add sheet
Copy to clipboard
import Sheet from "@/components/ui/sheet/Sheet.astro";
import SheetTrigger from "@/components/ui/sheet/SheetTrigger.astro";
import SheetOverlay from "@/components/ui/sheet/SheetOverlay.astro";
import SheetContent from "@/components/ui/sheet/SheetContent.astro";
import SheetHeader from "@/components/ui/sheet/SheetHeader.astro";
import SheetTitle from "@/components/ui/sheet/SheetTitle.astro";
import SheetDescription from "@/components/ui/sheet/SheetDescription.astro";
import SheetFooter from "@/components/ui/sheet/SheetFooter.astro";
import SheetClose from "@/components/ui/sheet/SheetClose.astro";
Usage
import {
Sheet,
SheetTrigger,
SheetOverlay,
SheetContent,
SheetHeader,
SheetTitle,
SheetDescription,
SheetFooter,
SheetClose
} from "@/components/ui"
<Sheet>
<SheetTrigger>Open</SheetTrigger>
<SheetOverlay />
<SheetContent>
<SheetHeader>
<SheetTitle>Sheet Title</SheetTitle>
<SheetDescription>Sheet description goes here.</SheetDescription>
</SheetHeader>
</SheetContent>
</Sheet>
Examples
Side positions
Copy to clipboard
Top Sheet
This sheet slides in from the top.
Right Sheet
This sheet slides in from the right.
Bottom Sheet
This sheet slides in from the bottom.
Left Sheet
This sheet slides in from the left.
Without close button
Copy to clipboard
No close button
Click outside or press Escape to close this sheet.
Navigation menu
Copy to clipboard
Navigation
Anatomy
Sheet- Root container that manages stateSheetTrigger- Button that opens the sheetSheetOverlay- Background overlaySheetContent- The sliding panelSheetHeader- Header containerSheetTitle- Title textSheetDescription- Description textSheetFooter- Footer containerSheetClose- Button that closes the sheet
Props
SheetContent
| Prop | Type | Default | Description |
|---|---|---|---|
| side | ”top” | “right” | “bottom” | “left" | "right” | Edge of screen to slide from |
| showCloseButton | boolean | true | Show the X close button |
| class | string | - | Additional CSS classes |