Overlay surface with canonical open state, dismissal policy, focus management, and reduced-motion behavior.
Install @wyrd-company/react or the Flutter package and use it directly —
your DESIGN.md does the styling.
catalog/contracts/dialog.ymlsource of truth · verbatim
$schema: https://thewyrdingway.dev/schemas/component-contract.schema.ymlcontractVersion: 0.1.0identity:name: Dialogtag: wyrd-dialogpackage: wyrd.component.dialogtitle: Dialogsummary: Overlay surface with canonical open state, dismissal policy, focus management, and reduced-motion behavior.relationships:related-to: - quality-parity-and-gatesclassification:category: overlaycomposition: overlayinteractive: truetarget-strategy:react: requiredflutter: requiredsurface:properties: - name: is-opentype:kind: booleanrequired: falsedefault: falsecontrolled: truereflects: trueserializable: truesummary: Controlled open state. - name: default-opentype:kind: booleanrequired: falsedefault: falseserializable: truesummary: Initial uncontrolled open state. - name: is-modaltype:kind: booleanrequired: falsedefault: truereflects: trueserializable: truesummary: Makes background content inert while the dialog is open. - name: dismissibletype:kind: booleanrequired: falsedefault: truereflects: trueserializable: truesummary: Allows Escape, backdrop (dialog variant only), and platform back navigation to request dismissal. - name: varianttype:kind: enumvalues: - dialog - alertdialogrequired: falsedefault: dialogreflects: trueserializable: truesummary: Selects ordinary dialog semantics or urgent alertdialog semantics.slots: - name: titlerequired: truecardinality: exactly-oneaccepts: - text - nodesummary: Dialog title and accessible-name source. - name: bodycontent: truerequired: truecardinality: one-or-manyaccepts: - content - nodesummary: Dialog body content. - name: actionsrequired: falsecardinality: zero-or-manyaccepts: - action - componentsummary: Dialog action area.events: - name: open-changepayload:is-open:kind: booleanreason:kind: enumvalues: - trigger - escape - backdrop - platform-back - action - programmaticbubbles: truecomposed: truecancelable: falsesummary: Canonical open-state change event. - name: dismisspayload:reason:kind: enumvalues: - escape - backdrop - platform-back - actionbubbles: truecomposed: truecancelable: truesummary: Dismissal request emitted before a dismissible dialog closes.states: - name: closedsource: behavior-runtimesummary: Dialog is absent from the active overlay surface. - name: openingsource: behavior-runtimesummary: Dialog is entering and focus is moving into the surface. - name: opensource: behavior-runtimesummary: Dialog is visible and owns modal focus semantics. - name: dismissingsource: behavior-runtimesummary: Dialog is exiting and focus is restoring.parts: - name: backdropsummary: Modal backdrop. - name: surfacesummary: Dialog surface container.slots: - title - body - actions - name: titlesummary: Title region.slots: - title - name: bodysummary: Body region.slots: - body - name: actionssummary: Action region.slots: - actionstokens:panel:background: color.surface-containerforeground: color.on-surfaceborder-color: color.outlinescrim:color: color.on-backgroundopacity: opacity.mutedborder-width: 1pxradius: rounded.lgpadding-x: spacing.lgpadding-y: spacing.lggap: spacing.mdmessages: []obligations:accessibility:role: Dialog variant uses dialog; alertdialog variant uses alertdialog.name: Title slot provides the accessible name.description: Alertdialog requires the body content to provide its accessible description; ordinary dialog body content may provide the description when declared by the target projection.keyboard: - Escape requests dismissal when dismissible is true. - Tab and Shift+Tab cycle inside a modal dialog.semantics: - Modal dialog makes background content inert on web targets. - Focus moves into the dialog on open and restores to trigger or return target on close. - Alertdialog wires its accessible description to the body content.behavior:model: behavior-runtimeruntimeBlueprint: behavior/dialog-open-closeinteractions: - Escape, platform back, and action dismissal request close when dismissible is true. - Backdrop dismissal requests close only when dismissible is true and variant is dialog. - Reduced motion collapses transform tracks while preserving state transitions and completion events.hostEffects: - Apply inert background. - Trap focus while modal. - Restore focus after close.conditions: - rtl - reduced-motion - cvd-deuteranopia - text-expansion - safe-areasdui:status: partialserializableProperties: - is-open - default-open - is-modal - dismissible - variantserializableSlots: - title - body - actionseventBindings: - open-change - dismissnotes: Open-state data is serializable; overlay host coordination, focus trap, inert background, and platform back behavior require host effects.examples: - name: usagestate: closedproperties:is-open: falseis-modal: trueslots:title: Confirm changesbody: Review the changes before continuing.actions: Cancel | Continue - name: closedstate: closedproperties:is-open: falseslots:title: Confirm changesbody: Review the changes before continuing. - name: openstate: openproperties:default-open: trueis-modal: trueslots:title: Confirm changesbody: Review the changes before continuing.actions: Cancel | Continue - name: alertdialogstate: openproperties:default-open: trueis-modal: truevariant: alertdialogslots:title: Delete project?body: This action permanently deletes the project and cannot be undone.actions: Cancel | Delete
01
Examples
Generated from the contract's examples block.
Previews are the published @wyrd-company/react component, themed by the
brand's role tokens — flip the site's light/dark toggle and they follow.
The specimen is the same published React component and contract example used above.
Indexed markers identify only regions the contract can ground; the typed ledger keeps
parts, slots, states, and semantic token bindings distinct.
ANATOMY · LIVE SPECIMENDialog open example · contract-derived
1
PartsurfaceDialog surface container.
The visible overlay surface.
2
ParttitleTitle region.
The visible title region.
3
SlotbodyDialog body content.
The example's body content region.
4
SlotactionsDialog action area.
The example's action region.
5
Tokenpanel.backgroundcolor.surface-container
The semantic panel background token applied to the surface.
Parts
backdropModal backdrop.
surfaceDialog surface container.
titleTitle region.
bodyBody region.
actionsAction region.
Slots
titleRequired · exactly-one
bodyRequired · one-or-many
actionsOptional · zero-or-many
States
closedDialog is absent from the active overlay surface.
openingDialog is entering and focus is moving into the surface.
openDialog is visible and owns modal focus semantics.
dismissingDialog is exiting and focus is restoring.
Tokens
panel.backgroundcolor.surface-container
panel.foregroundcolor.on-surface
panel.border-colorcolor.outline
scrim.colorcolor.on-background
scrim.opacityopacity.muted
border-width1px
radiusrounded.lg
padding-xspacing.lg
padding-yspacing.lg
gapspacing.md
FIG. 1 parts: backdrop · surface · title · body · actions TOL. ±0
03
Properties
Name
Type
Default
Summary
is-open
boolean
false
Controlled open state.
default-open
boolean
false
Initial uncontrolled open state.
is-modal
boolean
true
Makes background content inert while the dialog is open.
dismissible
boolean
true
Allows Escape, backdrop (dialog variant only), and platform back navigation to request dismissal.
variant
dialog | alertdialog
dialog
Selects ordinary dialog semantics or urgent alertdialog semantics.
04
Slots & events
Slot
Cardinality
Accepts
Summary
title
exactly-one
text, node
Dialog title and accessible-name source.
body
one-or-many
content, node
Dialog body content.
actions
zero-or-many
action, component
Dialog action area.
Event
Payload
Summary
open-change
is-open, reason
Canonical open-state change event.
dismiss
reason
Dismissal request emitted before a dismissible dialog closes.
05
Tokens
The contract's token bindings. Open the shared contextual sidebar from any example;
primary swatches reflect the color you pick there. Error swatches show the active
preset's values; editing any knob switches to custom and resets error to TWW · Ink.
Binding
Token
panel.background
color.surface-container
panel.foreground
color.on-surface
panel.border-color
color.outline
scrim.color
color.on-background
scrim.opacity
opacity.muted
border-width
1px
radius
rounded.lg
padding-x
spacing.lg
padding-y
spacing.lg
gap
spacing.md
06
States
State
Source
Summary
closed
behavior-runtime
Dialog is absent from the active overlay surface.
opening
behavior-runtime
Dialog is entering and focus is moving into the surface.
open
behavior-runtime
Dialog is visible and owns modal focus semantics.
dismissing
behavior-runtime
Dialog is exiting and focus is restoring.
07
Accessibility
From the contract's accessibility obligations. Role Dialog variant uses dialog; alertdialog variant uses alertdialog.; Title slot provides the accessible name.
Escape requests dismissal when dismissible is true.
Tab and Shift+Tab cycle inside a modal dialog.
Modal dialog makes background content inert on web targets.
Focus moves into the dialog on open and restores to trigger or return target on close.
Alertdialog wires its accessible description to the body content.
Status: partial. Open-state data is serializable; overlay host coordination, focus trap, inert background, and platform back behavior require host effects.