Primitive

Drawer

A drawer component for mobile devices. Built on top of Vaul.

Installation

npx benflux-ui add drawer

Usage

import {
  Drawer, DrawerContent, DrawerHeader,
  DrawerTitle, DrawerTrigger,
} from "@benflux-ui/react"

<Drawer>
  <DrawerTrigger asChild>
    <Button>Open</Button>
  </DrawerTrigger>
  <DrawerContent>
    <DrawerHeader>
      <DrawerTitle>Title</DrawerTitle>
    </DrawerHeader>
    Content here
  </DrawerContent>
</Drawer>

Props — Drawer

PropTypeDefaultDescription
shouldScaleBackgroundbooleanfalseScales the background when the drawer is open
openbooleanControlled open state
onOpenChange(open: boolean) => voidCalled when the open state changes