DIALOG
Modal overlay built on Radix UI. Corner-notched panel with animated entrance. Composable sub-components for header, body, and footer layout.
DEPS:@radix-ui/react-dialog
PREVIEW
INSTALLATION
USAGE
ANATOMY
DialogRoot — manages open/closed state via Radix.DialogTriggerWraps the element that opens the dialog.DialogContentThe panel — renders in a Portal with overlay. Contains close button.DialogHeaderTop section with bottom border. Place DialogTitle here.DialogTitleRequired for accessibility. Uppercase monospace heading.DialogDescriptionOptional body text. Muted color.DialogBodyMain content area with standard padding.DialogFooterBottom section with top border. Right-aligns action buttons.DialogCloseRe-exported Radix close primitive for custom close triggers.PROPS
| PROP | TYPE | DEFAULT | DESCRIPTION |
|---|---|---|---|
| open | boolean | — | Controlled open state. |
| onOpenChange | (open: boolean) => void | — | Callback fired when the dialog opens or closes. |
| defaultOpen | boolean | false | Initial open state (uncontrolled). |
| modal | boolean | true | When true, interaction outside the dialog is blocked. |
DialogContent, DialogHeader, DialogBody, DialogFooter extend React.HTMLAttributes<HTMLDivElement>.