Alert
Contextual message banner for feedback, warnings, or errors.
Renders with role="alert" so assistive tech announces it as soon as it mounts
— don’t use it for content that appears well before it’s relevant, since that
triggers an announcement immediately on page load too.
Example
Section titled “Example”<and-alert variant="default">Heads up — this is a default alert.</and-alert><and-alert variant="info">Here's some useful information.</and-alert><and-alert variant="success">Your changes were saved.</and-alert><and-alert variant="warning">Double-check this before continuing.</and-alert><and-alert variant="destructive" dismissible>Something went wrong.</and-alert>Properties
Section titled “Properties”| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
dismissible | dismissible | Whether the alert can be dismissed. | boolean | false |
variant | variant | Visual variant of the alert. | "default" | "destructive" | "info" | "success" | "warning" | 'default' |
Events
Section titled “Events”| Event | Description | Type |
|---|---|---|
andDismiss | Emitted when the alert is dismissed. | CustomEvent<void> |
Dependencies
Section titled “Dependencies”Depends on and-icon internally for the dismiss control.