Drawer
A bottom drawer panel that slides up from the bottom of the screen, ideal for mobile-first interactions like date pickers and action sheets.
Preview
Usage
tsx
import {
Drawer,
DrawerTrigger,
DrawerContent,
DrawerHeader,
DrawerTitle,
DrawerDescription,
DrawerFooter,
DrawerClose,
} from "zostel-ui";
<Drawer>
<DrawerTrigger asChild>
<Button>Open Drawer</Button>
</DrawerTrigger>
<DrawerContent>
<DrawerHeader>
<DrawerTitle>Select Dates</DrawerTitle>
<DrawerDescription>
Choose your check-in and check-out dates
</DrawerDescription>
</DrawerHeader>
<div className="px-4">
{/* Drawer content here */}
</div>
<DrawerFooter>
<Button>Confirm Dates</Button>
<DrawerClose asChild>
<Button variant="outline">Cancel</Button>
</DrawerClose>
</DrawerFooter>
</DrawerContent>
</Drawer>Props
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | — | Controlled open state of the drawer |
onOpenChange | (open: boolean) => void | — | Callback when the open state changes |
shouldScaleBackground | boolean | true | Whether the background content should scale down when the drawer is open |
dismissible | boolean | true | Whether the drawer can be dismissed by dragging down or clicking the overlay |
openType:
booleanDefault: —
Controlled open state of the drawer
onOpenChangeType:
(open: boolean) => voidDefault: —
Callback when the open state changes
shouldScaleBackgroundType:
booleanDefault: true
Whether the background content should scale down when the drawer is open
dismissibleType:
booleanDefault: true
Whether the drawer can be dismissed by dragging down or clicking the overlay