Stable
Alerts tell managers about something on the whole screen or a section: a save worked, something needs checking, or something went wrong. They sit at the top of the area they are about.
Specifications
Anatomy
Anatomy
Information
Neutral news: something is syncing, a change is coming.
Example
Example
Success
Confirms an action worked. Show it after saving.
Example
Example
Warning
Something needs attention soon, but nothing has failed.
Example
Example
Error
Something failed. Say what happened and what to do next.
Example
Example
Discovery
Something new worth knowing: a new feature, or a first-use tip. Show it once, and let managers dismiss it.
Example
Example
Usage
When to use
- After saving.
- When something on the page needs attention.
- At the top of a form that failed validation.
When not to use
- For a single field error: use the field error.
- For marketing or tips.
Content
- Lead with a short title: "Saved", "Could not save".
- Then one sentence on what to do next.
Do and don't
Do
- Say what happened and what to do next.
Don't
- Stack several alerts.
Implementation
HTML
<div class="at-stack at-stack--tight">
<div class="at-alert at-alert--info" role="status"><strong class="at-alert__title">Syncing</strong>Readings update every hour.</div>
<div class="at-alert at-alert--success" role="status"><strong class="at-alert__title">Saved</strong>Your settings are saved.</div>
<div class="at-alert at-alert--warning"><strong class="at-alert__title">Check the dates</strong>Two tenancies end this week.</div>
<div class="at-alert at-alert--danger" role="alert"><strong class="at-alert__title">Could not save</strong>COHO did not respond. Try again.</div>
</div>Classes
| Class | What it does |
|---|---|
at-alert | Neutral |
at-alert--info / --success / --warning / --danger | Variants |
at-alert__title | Bold first line |
at-alert--success | Success |
at-alert--warning | Warning |
at-alert--danger | Error |
at-alert--discovery | Something new |
Tokens used
--at-border, --at-bg-neutral, --at-border-info, --at-bg-info-subtle, --at-border-success, --at-bg-success-subtle, --at-border-warning, --at-bg-warning-subtle, --at-border-danger, --at-bg-danger-subtle, --at-border-discovery, --at-bg-discovery-subtle
Accessibility
- Use role="alert" for errors and role="status" for confirmations.