Skip to Content
Puzzle

Drawer

A resizable modal panel attached to a viewport edge.

Import

import { Drawer } from "@puzzle-ui/ui";

Position and dismissal

Provide controlled state and an accessible name. Drag the resize handle or use its keyboard interaction to resize. Dragging below the minimum dismisses the drawer.

390 × 450

API

PropTypeDefaultDescription
openbooleanRequiredControlled visibility.
onOpenChange(open: boolean) => voidRequiredVisibility-change request.
position"left" | "right" | "top" | "bottom""left"Viewport edge and transition direction.
closeOnEscapebooleantrueEscape dismissal.
aria-labelstring"Drawer"Accessible dialog name.
aria-labelledbystring-Visible heading ID; overrides aria-label.
childrenReactNode-Drawer content.

Supported div attributes and classes are forwarded to content. Drawer provides a modal backdrop, focus management, and scroll locking, but does not portal itself. Wrap it in Portal if ancestors would clip or constrain it. Backdrop clicks request closing; include an explicit close action.

;