Draft. Ported from the control-center Alert and styled with Beehexa tokens. Not yet approved. It is in the registry so teams can try it; the API may still change before approval.
An alert is a banner inside the page. It reports something about the page or the task in hand, and stays until the cause goes away.
When to use
- To report a state that lasts: a connection that is about to expire, a sync that is paused, data that is out of date.
- To report errors after a save, above the form, with what to fix.
- To give one fact people need before they start, such as when the next sync runs.
When not to use
- For the result of an action that needs no follow-up, such as “Product saved”. Use a toast.
- To ask people to decide something now. Use an alert dialog.
- For an error in one field. Put the message under the field.
- For anything that is not a status, such as marketing or tips. Too many banners teach people to skip them.
Roles
| Variant | Use for | Icon (Lucide) |
|---|---|---|
default |
Neutral information with no status | info or none |
info |
Information that changes how people work | info |
success |
A finished task that people waited for | circle-check |
warning |
Something that may go wrong unless people act | triangle-alert |
destructive (or danger) |
Something went wrong and work is blocked | octagon-x |
Always pair the colour with an icon and words that say the status, so it never rests on colour alone.
Content
- Title: what happened, in a few words. “Orders are not syncing”, not “Error”.
- Description: why, and what to do next. One or two sentences.
- Action: at most one, with a label that says what it does: “Reconnect”, not “OK”.
Placement
At the top of the area it is about: the page, a card or a form. Put it above the content, not between fields.
Tokens
| Part | Token |
|---|---|
| Fill | color.background.{role}.subtle (color.surface for default) |
| Edge | border.width.default, color.border.{role}.subtle (color.border for default) |
| Icon | size.icon.default, color.icon.{role} |
| Title | font.heading.xsmall, color.text |
| Description | font.body.default, color.text |
| Shape | radius.card, padding space.150 and space.100 |
Related
- Toast: a short message that goes away by itself.
- Color › Usage: status banners.