Alert component for informing users about important events.
Example
<.alert color="success" icon="hero-check-circle">
The purchase has been confirmed!
</.alert>
<.alert color="error" variant="soft" title="Erro" dismissable on_dismiss={JS.hide(to: "#my-alert")} id="my-alert">
Something went wrong. Please try again.
</.alert>
Summary
Functions
Attributes
id(:string) - Defaults tonil.color(:string) - Alert color: info, success, warning, error, or nil for neutral. Defaults tonil.variant(:string) - Visual style: solid (filled), soft (tinted), outline (bordered), dash (dashed border). Defaults to"solid".direction(:string) - Layout direction. Addclass="sm:flex-row sm:items-center"for responsive. Defaults to"horizontal".icon(:string) - Hero icon name rendered on the left. Defaults tonil.icon_class(:string) - Override icon color/size. Defaults tonil.title(:string) - Bold title above the message. Defaults tonil.dismissable(:boolean) - Show an × dismiss button. Defaults tofalse.on_dismiss(:any) - phx-click for the dismiss button (e.g. JS.hide). Defaults tonil.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required) - Alert message content.actions- Optional action buttons rendered on the right.