Usage

Flash

Flash messages are used to provide updates or alerts, including feedback about the outcome of an action. They can indicate a warning, error, success, or general information.


By default, Flash messages are dismissive, meaning they require the user to interact in order to close the alert. Passing show_close_button={false} renders a persistent banner that the user cannot dismiss (useful for messages that should stay until an underlying condition is resolved).


In situations where more than one flash message is needed, the FlashGroup component can be given a map of flashes:

<.flash_group flash={@flash} />

Call-to-action link

A single flash can include an optional inline call-to-action via the link_text and link_href attributes. This is typically a persistent banner (no close button) that points the user toward a next step:

<.flash
  kind={:error}
  icon="warning-circle"
  show_close_button={false}
  link_text="Go to Stripe"
  link_href={~p"/stripe"}
>
  To receive payments you need to provide your business information.
</.flash>

On wide screens the link sits at the end of the message row; on narrow screens it wraps below the message.