overlaysdialog
Dialog
Modal dialog with structured slots, backdrop overlay, and dismissal control.
Import#
Slot Structure#
Wrapper trigger with optional backdrop and a floating panel with title, body, and footer slots.
Examples#
Default Shell#
Header, description, actions, body, and footer slots.
Variants#
close supports default button, hidden, and custom JSX content.
Scrollable + Dismissible Control#
Scrollable body with prevent-close callback when dismiss is disabled.
API Reference#
Attributes#
Slot
trigger0 attributesElement users activate to open the dialog.
No attribute metadata for this slot.
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
| body | JSX.Element | — | Custom element to render in the body slot. |
| children | JSX.Element | — | Content to render inside the dialog trigger slot. |
| class | ClassValue | — | Class applied to the component root or trigger element. |
| classes | DialogT.Classes | undefined | — | Slot-based class overrides. |
| close | boolean | undefined | true | Whether to show a close button. |
| closeIcon | IconT.Name | JSX.Element | icon-close | Icon name or custom content for the close button. |
| defaultOpen | boolean | undefined | — | Initial open state when uncontrolled. |
| description | JSX.Element | — | Secondary description displayed below the title. |
| dismissible | boolean | undefined | — | Whether outside interaction and Escape should dismiss the shell. |
| footer | JSX.Element | — | Custom element to render in the footer slot. |
| fullscreen | boolean | undefined | false | Whether the dialog should take up the full viewport. |
| header | JSX.Element | — | Custom element to render in the header slot. |
| id | string | undefined | — | Unique identifier used to derive the content id. |
| layout | "default" | "scrollable" | "fullscreen" | undefined | — | — |
| onClosePrevent | (() => void) | undefined | — | Called when a dismissal attempt is blocked. |
| onOpenChange | ((open: boolean) => void) | undefined | — | Called whenever the open state changes. |
| open | boolean | undefined | — | Controlled open state. |
| overlay | boolean | undefined | — | Whether to render the overlay element. |
| ref | JSX.HTMLElementTags["span"] extends { ref?: infer Ref; } ? Ref : never | undefined | — | — |
| scrollable | boolean | undefined | false | Whether the dialog content body should be scrollable. |
| style | JSX.CSSProperties | undefined | — | — |
| styles | DialogT.Styles | undefined | — | Slot-based style overrides. |
| title | JSX.Element | — | Primary title displayed in the dialog header. |