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

open
Type: boolean
Default:

Controlled open state of the drawer

onOpenChange
Type: (open: boolean) => void
Default:

Callback when the open state changes

shouldScaleBackground
Type: boolean
Default: true

Whether the background content should scale down when the drawer is open

dismissible
Type: boolean
Default: true

Whether the drawer can be dismissed by dragging down or clicking the overlay