Skip to main content

Message

Block-level status feedback displayed after a user action - form submission, save, delete, or error. Supports the info, success, warning, and danger intents with type-specific icons. Distinct from announcement (global site-wide banner) and callout (editorial emphasis in body copy).

Usage​

When to use

  • Confirming a successful action (form saved, file uploaded)
  • Reporting an error from a user action (validation failure, save failed)
  • Non-blocking warnings or informational feedback tied to a recent interaction

When not to use

  • Site-wide notices unrelated to a specific action - use announcement
  • Editorial emphasis within body content - use callout
  • Inline form validation errors - use the form control's own error slot

Do

  • Place the message near the action it relates to
  • Use the correct variant so color and icon match the meaning
  • Include both an icon and text so meaning is not conveyed by color alone

Don't

  • Stack multiple unrelated messages on top of each other
  • Use an error variant for non-error feedback
  • Hide critical errors behind a dismissible banner

Choosing between intent and emphasis

intent and emphasis both color the surface and the left rule, and intent takes precedence wherever both are set: info, success, warning, or danger supplies the surface, the rule, the icon, and the link colors whatever emphasis is also present. Reach for subtle, neutral, or accent on a message that carries no status.

fill composes with whichever of the two is active. solid draws the surface and the rule, outline drops the surface, and ghost drops both, leaving a danger message as its icon and text alone.

API​

Slots​

SlotRequiredDescription
contentYesBody text content of the message.

Props​

PropTypeDefaultDescription
classesarray-Additional CSS class words merged into the root element.
attributesobject-Additional HTML attributes spread on the root element.

Classes​

ClassCapabilityDefaultDescription
.subtleEmphasis-Lower emphasis; a muted, quieter weight.
.neutralEmphasisYesDefault emphasis; the standard weight at balanced contrast.
.accentEmphasis-Higher emphasis; a stronger, louder weight.
.infoIntent-Informational message.
.warningIntent-Warning or caution.
.dangerIntent-Error, destructive, or critical.
.successIntent-Confirmation or completion.
.solidFill-Filled surface; background and border rendered.
.outlineFill-Bordered surface; transparent background.
.ghostFill-No surface; text or icon only.
.smSize-Small.
.mdSizeYesMedium.
.lgSize-Large.
.flatElevationYesNo elevation.
.raisedElevation-Slight elevation.

Examples​

Info​

Neutral informational feedback.

Success​

Successful action confirmation.

Warning​

Non-blocking warning.

Danger​

Danger feedback requiring attention.

Every intent carrying a link in its body, where the link color has to stay legible against the intent's own surface.

Accessibility​

  • WCAG 2.2 AA
  • Meaning is not conveyed by color alone - each variant carries a distinct icon and text
  • Success and info messages are announced politely to assistive technology
  • Error messages requiring attention are announced as alerts
  • Sufficient color contrast for text, icon, and background in every variant

Dependencies​

  • icon - status icons for each variant
  • announcement - global site-wide banner (different use case)
  • callout - editorial emphasis in body content