Binhlaig UI Component
Drawer
A gesture-enabled panel that slides from an edge of the screen for menus, filters, forms and details.
Installation
Install Drawer in your project.
Terminal
npx binhlaig-ui@latest add drawerFor project setup, installer selection, dependencies, and advanced installation instructions, see the Installation Guide.
View Installation Guide →Update or Overwrite →Import
Import Drawer primitives from your UI directory.
import {
Drawer,
DrawerBody,
DrawerClose,
DrawerContent,
DrawerDescription,
DrawerFooter,
DrawerHeader,
DrawerTitle,
DrawerTrigger,
} from "@/components/ui/drawer"Bottom Drawer
The default drawer opens from the bottom and supports swipe-to-dismiss.
Side Drawers
Match the drawer side with the swipe direction used to dismiss it.
Form Drawer
Use Drawer for compact mobile-friendly forms.
Controlled State
Control the drawer with React state.
API Reference
Main components and custom props available in the Binhlaig UI Drawer.
| Component | Purpose |
|---|---|
Drawer | Controls state and swipe behavior. |
DrawerTrigger | Opens the drawer. |
DrawerContent | Renders popup, overlay and viewport. |
DrawerHeader | Groups title and description. |
DrawerTitle | Accessible drawer title. |
DrawerDescription | Accessible supporting text. |
DrawerBody | Scrollable selectable content area. |
DrawerFooter | Aligns drawer actions. |
DrawerClose | Closes the drawer. |
| DrawerContent prop | Values | Default |
|---|---|---|
side | top, right, bottom, left | bottom |
showHandle | boolean | top/bottom only |
showCloseButton | boolean | false |