Sheet
A panel from the side: filters, a menu, a cart.
Preview
Usage
tsx
import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription, SheetClose, Button } from "zostel-ui";
<Sheet>
<SheetTrigger asChild><Button variant="outline">Filters</Button></SheetTrigger>
<SheetContent side="right">
<SheetHeader>
<SheetTitle>Filters</SheetTitle>
<SheetDescription>Narrow it down.</SheetDescription>
</SheetHeader>
…
<SheetClose asChild><Button>Show places</Button></SheetClose>
</SheetContent>
</Sheet>Sheet
| Prop | Type | Default | Description |
|---|---|---|---|
open / defaultOpen | boolean | — | Controlled / uncontrolled. |
onOpenChange | (open: boolean) => void | — | Called when it opens or closes. |
open / defaultOpenType:
booleanDefault: —
Controlled / uncontrolled.
onOpenChangeType:
(open: boolean) => voidDefault: —
Called when it opens or closes.
SheetContent
| Prop | Type | Default | Description |
|---|---|---|---|
side | "top" | "right" | "bottom" | "left" | "right" | The edge it comes from; bottom is the phone's sheet (rounded on top, clear of the home bar). The dialog's veil, panel and close (see Dialog). |
close | boolean | true | The built-in close control, top right; false when the sheet draws its own. |
container | HTMLElement | null | — | Where it mounts (document.body by default). |
className | string | — | More classes, merged with the component’s own (tailwind-merge). |
sideType:
"top" | "right" | "bottom" | "left"Default:
"right"The edge it comes from; bottom is the phone's sheet (rounded on top, clear of the home bar). The dialog's veil, panel and close (see Dialog).
closeType:
booleanDefault:
trueThe built-in close control, top right; false when the sheet draws its own.
containerType:
HTMLElement | nullDefault: —
Where it mounts (document.body by default).
classNameType:
stringDefault: —
More classes, merged with the component’s own (tailwind-merge).
Accessibility
Esc closes it, focus returns to the trigger, and the page behind is locked while it is open (Radix).