Drawer

Edge modal sheet with scrim, focus trap, and Escape to close.

Also known as: sheet, side sheet, bottom sheet

Installation

Install with the CLI, or copy the component source into your project.

Add drawer (npm)

npx --yes -p @default-file/ui df-ui add drawer

Default

Right edge sheet with scrim, labelled header, scrollable body, and footer actions. Open it from the trigger; the sheet covers the viewport and traps focus while open.

Canvas

Inspect document settings in the edge sheet.

Sides

Right and bottom edges. Choosing an edge opens the sheet so the scrim and body are on screen.

Choose an edge, then open the sheet.

Sizes

sm, md, and lg width steps on the right edge. Choosing a size opens the sheet.

Width steps for the right edge. sm, md, and lg.

Footer close

showClose false hides the header dismiss control. DrawerClose in the footer still dismisses.

Header close is off. Dismiss from the footer, Escape, or the scrim.

Controlled

Parent state owns open. A page button and the trigger both open the same sheet.

Sheet is closed.

Properties

Edge modal sheet with scrim, focus trap, and Escape to close. Compose trigger, content, header, title, description, body, footer, and close.

Drawer

PropTypeDefaultNotes
openboolean-Controlled open state.
defaultOpenbooleanfalseUncontrolled initial open state.
onOpenChange(open: boolean) => void-Called when open should change.
side"right" | "bottom""right"Edge the sheet enters from.
size"sm" | "md" | "lg""md"Sheet width or height step for the chosen side.
childrenReactNode-Usually DrawerTrigger and DrawerContent with header, body, and footer parts.

DrawerTrigger

PropTypeDefaultNotes
renderReactElement-Optional host element. Merges open semantics onto a kit Button or other control.
childrenReactNode-Trigger content for the default button.
classNamestring-Additional styles on the trigger.

DrawerContent

Portaled dialog panel with aria-modal. Includes a scrim that closes on click.

PropTypeDefaultNotes
childrenReactNode-Sheet content.
classNamestring-Additional styles on the panel.

DrawerHeader

PropTypeDefaultNotes
showClosebooleantrueShow the catalogue-labeled close control in the header.
childrenReactNode-Usually DrawerTitle and DrawerDescription.

DrawerTitle

PropTypeDefaultNotes
childrenReactNode-Dialog title. Required for the panel accessible name via aria-labelledby.

DrawerDescription

PropTypeDefaultNotes
childrenReactNode-Supporting copy. Wired as aria-describedby when present.

DrawerBody

PropTypeDefaultNotes
childrenReactNode-Scrollable main content inside a kit ScrollArea.

DrawerClose

PropTypeDefaultNotes
renderReactElement-Optional host for the dismiss control.
childrenReactNode-Label or icon when not using render.

Keyboard and accessibility

Role (dialog): Modal dialog with focus trap. Trigger exposes aria-expanded and aria-haspopup="dialog". Include DrawerTitle so aria-labelledby resolves. Dismiss (Escape / scrim): Escape and scrim click close the sheet and return focus to the trigger.