---
layout: layouts/component.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.
{% endset %}
{{ code_preview("alert", code) }}
Usage
You can use one of the two classes: alert or alert-dialog with any of the following children:
- A SVG icon,
- A
<h2> for the title.
- A
<section> for the description.
See the kitchen sink for more examples.
{{ code_block(code) }}
{% set code %}
{% lucide "circle-alert" %}
Something went wrong!
Your session has expired. Please log in again.
{% endset %}
{{ code_preview("alert-destructive", code) }}
{% 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) }}
{% set code %}
Success! Your changes have been saved
This is an alert with icon, title and description.
{% endset %}
{{ code_preview("alert-no-icon", code) }}