Alert

Alert - Phlex implementation

Examples

Default

A callout component for displaying important information.

<%= render "ui/alert" do %>
  <%= render "ui/alert/title" do %>Heads up!<% end %>
  <%= render "ui/alert/description" do %>You can add components to your app using the CLI.<% end %>
<% end %>

Destructive

Use the destructive variant to indicate an error or warning.

<%= render "ui/alert", variant: :destructive do %>
  <%= render "ui/alert/title" do %>Error<% end %>
  <%= render "ui/alert/description" do %>Your session has expired. Please log in again.<% end %>
<% end %>

Features

  • Custom styling with Tailwind classes

API Reference

Alert

A callout component for displaying important information to users.

Parameters

NameTypeDefaultDescription
variantSymbol:defaultVisual style variant

Description

Description text for an alert component.

Title

Title text for an alert component.

Accessibility

Implements the WAI-ARIA Alert pattern with proper roles, states, and keyboard navigation.

ARIA Attributes

  • role="alert"