defmodule PyrauiWeb.DocsLive.AlertDocs do use PyrauiWeb, :html def render(assigns) do ~H"""
Delightfully polished alerts for high-signal messaging. PyraUI ships crisp visuals, badges, call-to-actions, and micro-interactions so your feedback moments feel intentional and premium.
Real-world, unobtrusive notifications optimised for status and inline messaging.
<.alert variant={:success} title="Saved" message="Preferences updated" />
<.alert variant={:warning} dismissible title="Heads up" message="Verify your billing email" />
Layer badges, richer copy, and inline CTAs when an alert should guide the next step.
The adoption squad will host a live AMA tomorrow so your teams can explore workflows in real time.
<:actions>The payment method ending in 6728 requires verification. Update details within the next 48 hours to prevent service interruption.
<:actions>
<.alert
variant={:celebrate}
badge="Celebration"
title="Product adoption is soaring"
>
<p>Activations grew 34% this sprint. Give the GTM team a high five!</p>
<:actions>
<.button variant={:ghost} size={:sm}>Share announcement</.button>
</:actions>
</.alert>
Alerts love progressive disclosure. Combine dismissal, custom copy, and inline CTAs for effortless follow-up.
Restart before 09:00 to ensure production nodes receive the latest runtime patches and observability tweaks.
<:actions>
<.alert variant={:info} badge="Update" title="New release" dismissible>
<p>Your workspace can opt-in to the latest features right away.</p>
<:actions>
<.button variant={:primary} size={:sm}>Enable now</.button>
<.button variant={:ghost} size={:sm}>Later</.button>
</:actions>
</.alert>
Configure alerts with a small, expressive API. Defaults are optimised for accessibility, motion polish, and theming.
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | atom | :info | Choose the tone. Supports :info, :success, :warning, :danger, :celebrate, :neutral, :note. |
| title | string | nil | nil | Optional heading that anchors the message hierarchy. |
| message | string | nil | nil | Plain string message. Compose markup inside the component for richer content. |
| badge | string | nil | nil | Adds a high-contrast capsule label (e.g. “Launch”, “Critical”). |
| icon | string | nil | auto | Override the hero icon. Defaults to a tone-aware icon. |
| dismissible | boolean | false | Allow users to close the alert once acknowledged. |
| class | string | "" | Append classes to the outer container for bespoke layout tuning. |
| slots | actions | — |
Use the :actions
slot for inline call-to-actions.
|