Alert box
The inherited Ecology alert, wearing the CBFish skin. An inline status message with a variant-mapped icon, optional title, and optional dismiss control; tones resolve from the spoke's semantic tokens.
Preview
Heads up
<AlertBox variant="info" title="Heads up">
This is an informational message.
</AlertBox> Variants
Heads up
Saved
Check this
Error
<AlertBox variant="info" title="Heads up">This is an informational message.</AlertBox>
<AlertBox variant="success" title="Saved">Your changes were saved successfully.</AlertBox>
<AlertBox variant="warning" title="Check this">Some fields need your attention.</AlertBox>
<AlertBox variant="danger" title="Error">Something went wrong while saving.</AlertBox> States
The title is optional — omit it for a compact single-line alert. With dismissable, a close button appears and a dismissed event bubbles on click.
Dismiss me
<AlertBox variant="info">A compact, single-line alert with just a message.</AlertBox>
<AlertBox variant="warning" title="Dismiss me" dismissable={true}>Click the × to hide this alert.</AlertBox> API
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'info' | 'success' | 'warning' | 'danger' | 'info' | Tone — drives the background, border, and auto-mapped icon. |
title | string | — | Optional bold heading above the message. |
dismissable | boolean | false | Shows a close button that hides the alert and emits a dismissed event. |
Events
| Event | Type | Default | Description |
|---|---|---|---|
dismissed | CustomEvent | — | Bubbles when the close button is clicked (dismissable only). |