Skip to content

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.

Maturity
beta
Links
Storybook · Figma · Spec source · Usage source

Anatomy

Remove this course?

Your progress in Color Theory II will be deleted. This can't be undone.

Patternconfirm-action

Not marked: Backdrop (when nonModal is false). A pseudo-element of the modal dialog: it has no DOM node to carry data-part.

Props

PropTypeDefaultOptions
openboolean——
onOpenChange(open: boolean) => void——
titlestring——
descriptionstring——
childrenReactNode——
actionsReactNode——
headingLevel2 | 3 | 4 | 5 | 62—
nonModalbooleanfalse—
classNamestring——
idstring——

Tokens

StateTokens
Defaultborder-boxsize.dialog.maxspace.inset.mdspace.inset.lgspace.inset.xs0color.background.container.elevatedcolor.text.default1pxsolidcolor.border.subtleborder-radius.mdcolor.background.overlay.subtlecolor.background.scrim
nonModal="true"static0100%
actions="unset"0
openflexcolumn
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.