Alerts — a callout that draws attention to a message.
A port of the Pines alert.
<.alert title="Heads up!">You can add components to your app.</.alert>
<.alert variant="danger" title="Something went wrong" />
Summary
Feedback
Renders an alert.
Feedback
Renders an alert.
Examples
<.alert title="Heads up!">
You can add components to your app using the CLI.
</.alert>
<.alert variant="danger" title="Payment failed" dismissible>
Your card was declined. Please try another payment method.
</.alert>Accessibility
Renders with role="alert" for the danger and warning variants, so assistive
technology announces them promptly, and role="status" otherwise, which announces
politely without interrupting.
Attributes
variant(:string) - Defaults to"default". Must be one of"default","success","warning","danger", or"info".title(:string) - Heading text. Shadows the HTMLtitleattribute. Defaults tonil.show_icon(:boolean) - Shows the variant's default icon. Pass an:iconslot to supply your own instead. Defaults totrue.dismissible(:boolean) - Adds a close button. Requires Alpine. Defaults tofalse.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block- Body text.icon- Overrides the default icon.