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 github:itsvigneshv/default-file-ui#main df-ui add drawer

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.