defmodule PyrauiWeb.DocsLive.AlertDocs do use PyrauiWeb, :html def render(assigns) do ~H"""
Alert Showcase

Alert

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.

Quick Alerts

Real-world, unobtrusive notifications optimised for status and inline messaging.

Compact by default
    
    <.alert variant={:success} title="Saved" message="Preferences updated" />
    <.alert variant={:warning} dismissible title="Heads up" message="Verify your billing email" />
    
            

Enhanced Experiences

Layer badges, richer copy, and inline CTAs when an alert should guide the next step.

Motion aware

The adoption squad will host a live AMA tomorrow so your teams can explore workflows in real time.

<:actions> View dashboard Share update

The payment method ending in 6728 requires verification. Update details within the next 48 hours to prevent service interruption.

<:actions> Update billing
<:actions> Compose thank you
  • • 3 new integrations joined the marketplace
  • • Team velocity improved by 12%
  • • 2 accessibility upgrades shipped in Designer
    
    <.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>
    
            

Dismissible + Actions

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> Apply update Remind me later
    
    <.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>
    
            

Props

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.
""" end end