Tells someone about something that needs their attention, in one of five tones.
Live React portVue source: WildAlert.vueStorybook story: Feedback/AlertReact component: WAlert
Try it
Switch the variant, then press the cross or tab to it.
Battery below 20%Logger 4412 will stop reporting in about six days.
Variant
Size
Title
Dismissible
<WildAlert
variant="warning"
size="md"
title="Battery below 20%"
dismissible
@dismiss="hide"
>
Logger 4412 will stop reporting in about six days.
</WildAlert>
When to use
Use an alert for a condition that affects the page or panel it sits in.
Use one per region, at the top of what it describes.
Let people dismiss it only once the message has done its job.
Don’t use it
To confirm an action that just finished. Use a toast.
When there’s nothing to show yet. Use an empty state.
Variants
Five tones. Pick by meaning: warning and error ask for action; info, success and neutral only inform.
New schedule for logger 4412Readings now arrive every fifteen minutes.
Logger 4412 is reportingIts readings will appear here within fifteen minutes.
Battery below 20%Logger 4412 will stop reporting in about six days.
Sync failedThree sites didn’t report in the last window. Try again in a few minutes.
Maintenance on SundayReadings may arrive late between 2am and 4am.
<WildAlert variant="warning" title="Battery below 20%">
Logger 4412 will stop reporting in about six days.
</WildAlert>
Readings arrive every fifteen minutes.
<WildAlert variant="info">Readings arrive every fifteen minutes.</WildAlert>
Drop the title in dense screens, where one line of consequence is enough.
Sizes
Three, with 13, 14 and 15px text. The icon and the cross scale with the padding.
Size smReadings arrive every fifteen minutes.
Size mdReadings arrive every fifteen minutes.
Size lgReadings arrive every fifteen minutes.
Use sm inside forms and panels, md for page banners and lg for a page with little else on it.
Content
Put the fact in the title: “Battery below 20%”.
Put the consequence or the next step in the body: “Logger 4412 will stop reporting in about six days.”
Keep the title to six words or fewer, in sentence case, with no full stop.
Name the logger or site, so nobody has to guess which one.
Accessibility
Error and warning are announced as they appear; the other tones wait their turn. The cross is named “Dismiss” plus the title, so a stack of alerts stays distinguishable.
Key
What it does
Tab
Moves focus to the cross, when the alert is dismissible.
Enter / Space
Dismisses the alert and moves focus to the next control.