Dialog
A titled panel that takes focus: modal over an inert page, or non-modal in the page flow. Focus returns to its trigger on close.
Anatomy
Not marked: Backdrop (when nonModal is false). A pseudo-element of the modal dialog: it has no DOM node to carry data-part.
Props
| Prop | Type | Default | Options |
|---|---|---|---|
open | boolean | — | — |
onOpenChange | (open: boolean) => void | — | — |
title | string | — | — |
description | string | — | — |
children | ReactNode | — | — |
actions | ReactNode | — | — |
headingLevel | 2 | 3 | 4 | 5 | 6 | 2 | — |
nonModal | boolean | false | — |
className | string | — | — |
id | string | — | — |
Tokens
| State | Tokens |
|---|---|
| Default | |
nonModal="true" | |
actions="unset" | |
| open | |
| Default | |
| Default | |
| Default | |
| Default | |
children="set" | |
| Default | |
actions="unset" | |
| Default | |
description="set" | |
children="set" | |
token.name- Token this component sets
token.name- Token from the component the part is built on; hover it for which
value- Raw value with no token; hover it for the reason
Every component follows ADR-025, ADR-026 and ADR-028(states, prop vocabulary, focus indicator); they are not repeated per component.