Skip to Content
Puzzle

Dialog

Focused modal content with an accessible title and dismissal controls.

Import

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

Dialog is controlled. Supply a title, update open from onOpenChange, and provide explicit footer actions when needed. This example portals into the host page.

390 × 300

API

PropTypeDefaultDescription
openbooleanRequiredControlled visibility.
onOpenChange(open: boolean) => voidRequiredState-change request.
titleReactNodeRequiredAccessible heading.
descriptionstring-Associated short description.
children, footerReactNode-Body and footer content.
size"sm" | "md" | "lg" | "xl" | "full""md"Width preset.
closeButtonbooleantrueShow the close button.
closeLabelstring"Close dialog"Close button accessible name.
closeOnBackdrop, closeOnEscapebooleantrueEnable dismissal mechanisms.
onClose() => void-Called when dismissal is requested.
aria-describedbystring-Additional description IDs.

Supported div attributes, classes, and styles apply to the dialog content. The component provides modal semantics, focus management, scroll locking, and portal placement. Keep an accessible close action if disabling built-in dismissal. Use headings in a logical order within the body.

;