LanternUI.Components.Alert (LanternUI v0.8.2)

Copy Markdown View Source

Inline status alert. Mirrors Fluxon's alert/1 surface.

<.alert color="success" title="Saved">Your changes were stored.</.alert>
<.alert color="warning" title="Unsaved" hide_close={false}>
  Discard or save before leaving.
</.alert>

Summary

Functions

alert(assigns)

Attributes

  • id (:string) - Element id; auto-generated when omitted. Defaults to nil.
  • title (:string) - Primary heading shown next to the icon. Defaults to nil.
  • subtitle (:string) - Secondary line under the title. Defaults to nil.
  • color (:string) - Semantic color; also picks the default status icon. Defaults to "neutral". Must be one of "neutral", "info", "success", "warning", or "danger".
  • hide_icon (:boolean) - Omit the leading status icon. Defaults to false.
  • hide_close (:boolean) - Hide the dismiss button (default). Defaults to true.
  • on_close (:any) - JS command run when the alert is dismissed (Fluxon parity); its presence shows the close button. Defaults to hiding the alert. Defaults to nil.
  • class (:any) - Extra classes merged onto the root element. Defaults to nil.
  • Global attributes are accepted. Arbitrary HTML/phx-* attributes passed through.

Slots

  • icon - Custom leading icon; overrides the color default.
  • inner_block - Alert body content below the title.