Drawer
open and pass onOpenChange.Drawer
open- is required — the drawer has no uncontrolled mode.
onOpenChange- is also required, and fires on the overlay click, Escape and the close button alike.
Installation
New project? Follow the installation guide to set up Tailwind CSS, shadcn, the cn helper and lucide-react, register the @algorize-ui registry once, then copy your styles from the Themes page.
Install Drawer
components/ is written into your project. Copy any snippet from a Usage tab above and it runs.
Install dependencies
Nothing beyond the shared setup — Drawer needs only the cn helper and lucide-react, which the installation guide already put in place.
Examples
Bottom sheet
- Set
side"bottom" - for the familiar full-width mobile sheet.
Open on mount
open- being yours means you can start it
true, or flip it from any effect, with no trigger element at all.
Features
Customizable
Easily adapt the component's styling and behavior to fit your application's unique design system.
Accessible
Built with accessibility in mind, ensuring all users can interact with your application effectively.
Responsive
Fully responsive design that looks and works great across desktop, tablet, and mobile devices.
Performant
Optimized for maximum performance with minimal re-renders and efficient state management.
Best Practices & Guidelines
Usage Guidelines
Follow standard design principles when implementing this component. Ensure proper contrast, spacing, and context within your layout.
Props Reference
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | Required | Controls the visible state of the drawer. When true, the component
mounts via React Portals and a CSS transition slides it into view. |
onOpenChange | (open: boolean) => void | Required | Callback function to update the open state. Triggered by
clicking the overlay, hitting the Escape key, or using the close
button. |
side | "top" | "bottom" | "left" | "right" | "right" | Determines which edge of the screen the drawer slides in from, and
applies the corresponding layout dimensions. |