Drawer

Displays content in a panel that slides in from the edge of the screen.

Configurations

Supported configurations for this component.

Configurations

2 examples
Right
Left

Add to your project

One command adds this component to your project.

1

Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.

npx shadcn@latest add @aicanvas/••••••••••••

Light and dark both come with the install and follow the dark class on <html>, the shadcn dark mode setup (next-themes with attribute="class").

Props

Every prop this component accepts. Any other prop is forwarded to the underlying element.

PropTypeDefaultDescription
openreqboolean-Whether the drawer is open.
onOpenChange(next: boolean) => void-Handler called with the next open state when the drawer requests to close (ESC or backdrop click).
side'left'|'right''right'Screen edge the panel slides in from.
sizenumber|string420Panel width. Number → px, string passed through.
childrenReact.ReactNode-Panel content, typically the Drawer compound parts (Header, Body, Footer).
classNamestring-Extra classes merged onto the panel element.
styleReact.CSSProperties-Inline styles merged onto the panel element.

More Andromeda Pro components