Dialog

Center modal with scrim, focus trap, Escape to close, and scroll lock.

Installation

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

Add dialog (npm)

npx --yes -p github:itsvigneshv/default-file-ui#main df-ui add dialog

Basic

Trigger, title, body, and footer close action.

Properties

Center modal with scrim, focus trap, Escape to close, and body scroll lock. Use for instructional or confirmational content that should interrupt the page.

Dialog

PropTypeDefaultNotes
openboolean-Controlled open state.
defaultOpenbooleanfalseInitial open state when uncontrolled.
onOpenChange(open: boolean) => void-Called when open state should change.
childrenReactNode-Compose with DialogTrigger, DialogContent, and the header, body, and footer parts.

DialogTrigger

PropTypeDefaultNotes
renderReactElement-Optional host element. Merge trigger props onto a kit Button or other control.
childrenReactNode-Trigger label when rendering the default button.

DialogContent

PropTypeDefaultNotes
classNamestring-Classes on the dialog panel.
childrenReactNode-Panel contents. Prefer DialogHeader, DialogBody, and DialogFooter.

DialogHeader

PropTypeDefaultNotes
showClosebooleantrueShow the trailing close control in the header.
childrenReactNode-Usually DialogTitle and DialogDescription.

DialogTitle

PropTypeDefaultNotes
childrenReactNode-Accessible dialog title. Wired to aria-labelledby.

DialogDescription

PropTypeDefaultNotes
childrenReactNode-Supporting copy under the title. Wired to aria-describedby.

DialogBody

PropTypeDefaultNotes
childrenReactNode-Scrollable main content.

DialogClose

PropTypeDefaultNotes
renderReactElement-Optional host element. Merge close props onto a kit Button.
childrenReactNode-Close control label when rendering the default button.