Drawer
Slide-out side panel for navigation, filters, and mobile menus with model binding support.
Import
import { Drawer, Text } from '@sigx/daisyui';
Basic Drawer
Use model for two-way binding to control drawer visibility. The Drawer component should wrap your main content:
Loading preview...
Drawer Positions
Right Side Drawer
Use side="right" (adds drawer-end class) to open the drawer from the right:
Loading preview...
Navbar with Drawer
A common pattern with navbar and drawer for mobile navigation:
Loading preview...
Responsive Drawer
Drawer that's always visible on large screens using responsive prop (adds lg:drawer-open class):
Loading preview...
Filter Drawer
A right-side filter panel commonly used in e-commerce:
Loading preview...
Props
| Prop | Type | Default | Description |
|---|---|---|---|
model | () => boolean | - | Two-way binding for open state |
side | 'left' | 'right' | 'left' | Which side the drawer opens from |
responsive | boolean | false | Always visible on large screens (lg:drawer-open) |
class | string | - | Additional CSS classes |
Slots
| Slot | Description |
|---|---|
default | Main content area (goes in drawer-content) |
side | Drawer sidebar content (goes in drawer-side) |
DaisyUI Classes Reference
| Class | Description |
|---|---|
drawer | The wrapper for sidebar and content |
drawer-toggle | Hidden checkbox that controls the state |
drawer-content | Content part |
drawer-side | Sidebar part |
drawer-overlay | Label that covers the page when open |
drawer-end | Opens drawer from the right side |
drawer-open | Forces the drawer to be open |