Flash

Flash notifications for displaying temporary feedback messages after actions.

Info Flash

Use kind=info for success messages, confirmations, and general information.

Info

Error Flash

Use kind=error for error messages and validation failures.

Error

With Title

Add a title for additional context using the title prop.

With Title

With Formatting

The inner block supports HTML for rich content.

With Formatting

Usage with LiveView

In LiveView, use put_flash/3 to set flash messages that will be displayed automatically.

def handle_event("save", params, socket) do
  case save_data(params) do
    {:ok, _} ->
      {:noreply, put_flash(socket, :info, "Changes saved!")}
    {:error, _} ->
      {:noreply, put_flash(socket, :error, "Failed to save")}
  end
end