AvenUI.Components.Alert (AvenUI v1.0.0)

Copy Markdown View Source

Alert/notification banners for inline feedback messages.

Supports an optional title, description slot, dismissible behavior via LiveView events, and an icon slot for custom icons.

Examples

<.alert variant="success" title="Deployment complete">
  Version 2.4.1 is now live across 3 nodes.
</.alert>

<.alert variant="warning" title="High memory usage" dismissible phx-click="dismiss_alert">
  Node #3 is at 87% — consider restarting.
</.alert>

<.alert variant="danger">
  <:icon><.icon name="hero-exclamation-circle" /></:icon>
  <:title>Database error</:title>
  Cannot connect to Postgres on port 5432.
</.alert>

Summary

Functions

Renders an alert banner with optional icon, title, and dismissible behavior.

Functions

alert(assigns)

Renders an alert banner with optional icon, title, and dismissible behavior.

Attributes

  • variant (:string) - Defaults to "info". Must be one of "info", "success", "warning", or "danger".
  • title (:string) - Defaults to nil.
  • dismissible (:boolean) - Defaults to false.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["phx-click", "phx-target"].

Slots

  • icon
  • title_slot - Optional named slot for the title (alternative to title attr).
  • inner_block