Drawer

A panel that slides in from the edge of the screen. Useful for navigation menus, settings panels, or detailed views.

Basic Usage

Basic Drawer

A simple drawer that slides in from the right side.

Sides

Drawer Sides

The drawer can slide in from any side: left, right (default), top, or bottom.

With Form

Drawer with Form

Drawers are great for forms and settings panels.

Resizable Drawer

Resizable Navigation

A resizable drawer with drag handle. Min width: 300px, Max width: 90vw.

Without Close Button

No Close Button

Hide the default close button with showCloseButton=false.

API Reference

DrawerContent

PropTypeDefaultDescription
side"left" | "right" | "top" | "bottom""right"The side from which the drawer slides in
showCloseButtonbooleantrueShow the X close button
classstring-Additional CSS classes

Drawer

PropTypeDefaultDescription
openbooleanfalseControlled open state
onOpenChange(open: boolean) => void-Callback when open state changes

Components

ComponentDescription
DrawerRoot component that manages open/close state
DrawerTriggerButton that opens the drawer when clicked
DrawerContentThe main content panel of the drawer
DrawerHeaderContainer for the title and description
DrawerFooterContainer for action buttons
DrawerTitleThe title of the drawer
DrawerDescriptionA description below the title
DrawerCloseButton that closes the drawer when clicked
DrawerOverlayThe backdrop overlay behind the drawer
DrawerPortalPortal for rendering drawer outside DOM tree