Skip to content

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.

Heads up — this is a default alert. Here's some useful information. Your changes were saved. Double-check this before continuing. Something went wrong.
<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>
PropertyAttributeDescriptionTypeDefault
dismissibledismissibleWhether the alert can be dismissed.booleanfalse
variantvariantVisual variant of the alert."default" | "destructive" | "info" | "success" | "warning"'default'
EventDescriptionType
andDismissEmitted when the alert is dismissed.CustomEvent<void>

Depends on and-icon internally for the dismiss control.

Generated from `packages/web-components/src/components/and-alert/readme.md` — keep this table in sync with the Stencil source, don't hand-edit the numbers.