Presentational toast surface with variant styling and localized dismiss affordance.
Install @wyrd-company/react or the Flutter package and use it directly —
your DESIGN.md does the styling.
catalog/contracts/toast.ymlsource of truth · verbatim
$schema: https://thewyrdingway.dev/schemas/component-contract.schema.ymlcontractVersion: 0.1.0identity:name: Toasttag: wyrd-toastpackage: wyrd.component.toasttitle: Toastsummary: Presentational toast surface with variant styling and localized dismiss affordance.relationships:related-to: - quality-parity-and-gatesclassification:category: feedbackcomposition: single-slotinteractive: truetarget-strategy:react: requiredflutter: requiredsurface:properties: - name: varianttype:kind: enumvalues: - info - success - warning - dangerrequired: falsedefault: inforeflects: trueserializable: truesummary: Visual status tone.slots: - name: contentcontent: truerequired: truecardinality: exactly-oneaccepts: - text - nodesummary: Toast message content. - name: iconrequired: falsecardinality: zero-or-oneaccepts: - iconsummary: Optional decorative status icon.events: - name: dismisspayload: {}bubbles: truecomposed: truecancelable: truesummary: Emitted when the user activates the dismiss button.states: - name: defaultsource: platformsummary: Informational toast surface.parts: - name: rootsummary: Toast status surface.slots: - content - icon - name: iconsummary: Optional icon slot container.slots: - icon - name: contentsummary: Toast message body.slots: - content - name: dismisssummary: Dismiss button.tokens:info:background: color.secondaryforeground: color.on-secondarysuccess:background: color.success-containerforeground: color.on-success-containerwarning:background: color.warning-containerforeground: color.on-warning-containerdanger:background: color.error-containerforeground: color.on-error-containerradius: rounded.mdshadow: shadow.mdpadding-x: spacing.mdpadding-y: spacing.smgap: spacing.smmessages: - key: toast.dismissdescription: Accessible label for the toast dismiss control.obligations:accessibility:role: statusname: Toast content provides the announced status text.keyboard: - Tab moves focus to the dismiss control. - Enter or Space activates the dismiss control when focused.semantics: - Web projections expose role=status as a polite live region. - The dismiss control is a button named by the component-owned localized message. - The optional icon is decorative unless the host supplies semantic content inside it.behavior:model: statelessinteractions: - Activating the dismiss control emits dismiss. - Toast v1 is presentational only.hostEffects: - Dispatch dismiss event. - Hosts own toast queueing, placement, lifecycle, and auto-dismiss timing until the overlay-host service exists.conditions: - rtl - reduced-motion - cvd-deuteranopia - density-compact - text-expansionsdui:status: serializableserializableProperties: - variantserializableSlots: - content - iconeventBindings: - dismissnotes: Toast serializes only the presentational surface, icon, content, variant, and dismiss binding. Queueing, placement, auto-dismiss timing, and overlay host behavior are host responsibilities in v1.examples: - name: infostate: defaultproperties:variant: infoslots:content: Draft saved.icon: i - name: successstate: defaultproperties:variant: successslots:content: Publish completed.icon: check - name: warningstate: defaultproperties:variant: warningslots:content: Publishing is delayed while validation finishes.icon: alert - name: dangerstate: defaultproperties:variant: dangerslots:content: Publish failed.icon: alertoverrides:react:slots:content: childrenflutter:slots:content: child
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.
Emitted when the user activates the dismiss button.
04
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
info.background
color.secondary
info.foreground
color.on-secondary
success.background
color.success-container
success.foreground
color.on-success-container
warning.background
color.warning-container
warning.foreground
color.on-warning-container
danger.background
color.error-container
danger.foreground
color.on-error-container
radius
rounded.md
shadow
shadow.md
padding-x
spacing.md
padding-y
spacing.sm
gap
spacing.sm
05
States
State
Source
Summary
default
platform
Informational toast surface.
06
Accessibility
From the contract's accessibility obligations. Role status; Toast content provides the announced status text.
Tab moves focus to the dismiss control.
Enter or Space activates the dismiss control when focused.
Web projections expose role=status as a polite live region.
The dismiss control is a button named by the component-owned localized message.
The optional icon is decorative unless the host supplies semantic content inside it.
Status: serializable. Toast serializes only the presentational surface, icon, content, variant, and dismiss binding. Queueing, placement, auto-dismiss timing, and overlay host behavior are host responsibilities in v1.