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
| Slot | Required | Description |
|---|---|---|
content | Yes | Body text content of the message. |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
classes | array | - | Additional CSS class words merged into the root element. |
attributes | object | - | Additional HTML attributes spread on the root element. |
Classes
| Class | Capability | Default | Description |
|---|---|---|---|
.subtle | Emphasis | - | Lower emphasis; a muted, quieter weight. |
.neutral | Emphasis | Yes | Default emphasis; the standard weight at balanced contrast. |
.accent | Emphasis | - | Higher emphasis; a stronger, louder weight. |
.info | Intent | - | Informational message. |
.warning | Intent | - | Warning or caution. |
.danger | Intent | - | Error, destructive, or critical. |
.success | Intent | - | Confirmation or completion. |
.solid | Fill | - | Filled surface; background and border rendered. |
.outline | Fill | - | Bordered surface; transparent background. |
.ghost | Fill | - | No surface; text or icon only. |
.sm | Size | - | Small. |
.md | Size | Yes | Medium. |
.lg | Size | - | Large. |
.flat | Elevation | Yes | No elevation. |
.raised | Elevation | - | Slight elevation. |
Examples
Info
Neutral informational feedback.
Success
Successful action confirmation.
Warning
Non-blocking warning.
Danger
Danger feedback requiring attention.
With links
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
Related
- announcement - global site-wide banner (different use case)
- callout - editorial emphasis in body content