For supplementary information that doesn't require the user's immediate
attention, use callout/1 instead.
Maturity: Developing
Usage
Minimal example:
<.alert id="some-alert"></.alert>
With title, icon and level:
<.alert id="some-alert" level={:info}>
<:title>Info</:title>
message
<:icon><Heroicon.light_bulb /></:icon>
</.alert>
Dismissable:
<.alert id="some-alert" on_close={JS.push("dismiss")}>
message
</.alert>
The close button's name and content are set in the build call:
build_alert(close_label: gettext("Dismiss"), close: ~H|<Heroicon.x_mark />|)
With an action:
<.alert id="some-alert">
<:title>Session expired</:title>
Your session has expired. Sign in again to continue.
<:action>
<.button phx-click="sign-in">Sign in</.button>
</:action>
</.alert>
The close_label is the button's accessible name, so it is needed whether
or not close is set.