--- layout: layouts/page.njk title: Alert description: Displays a callout for user attention. toc: - label: Usage id: usage - label: Examples id: examples children: - label: Destructive id: example-destructive - label: No description id: example-no-description - label: No icon id: example-no-icon --- {% from "macros/code_preview.njk" import code_preview %} {% from "macros/code_block.njk" import code_block %} {% set code %}
{% lucide "circle-check" %}

Success! Your changes have been saved

This is an alert with icon, title and description.
{% lucide "popcorn" %}

This Alert has a title and an icon. No description.

This is an alert with icon, title and description.
{% lucide "circle-check" %}

Unable to process your payment.

Please verify your billing information and try again.

  • Check your card details
  • Ensure sufficient funds
  • Verify billing address
{% endset %} {{ code_preview("alert", code | prettyHtml) }}

Usage

Use the alert or alert-destructive.

{% set code_simple %}
{% lucide "circle-check" %}

Success! Your changes have been saved

This is an alert with icon, title and description.
{% endset %} {{ code_block(code_simple | prettyHtml) }}

The component has the following HTML structure:

<div class="alert">
Main container. Use alert for default styling or alert-destructive for error states.
<svg> Optional
The icon.
<h2>
The title.
<section> Optional
The description.

Examples

Destructive

{% set code %}
{% lucide "circle-alert" %}

Something went wrong!

Your session has expired. Please log in again.
{% endset %} {{ code_preview("alert-destructive", code) }}

No description

{% set code %}
{% lucide "shield-alert" %}

This is a very long alert title that demonstrates how the component handles extended text content and potentially wraps across multiple lines

{% endset %} {{ code_preview("alert-no-description", code) }}

No icon

{% set code %}

Success! Your changes have been saved

This is an alert with icon, title and description.
{% endset %} {{ code_preview("alert-no-icon", code) }}