Toggle Sidebar B
AppearanceLight & dark mode D

Alert

Inline message for status, warnings, or callouts. Two visual variants and slots for an icon, title, and description.

Demo

Alerts with an icon, title and description.

Replay preview

Basic

A basic alert with an icon, title and description.

Replay preview

Destructive

Use variant="destructive" to create a destructive alert.

Replay preview

Action

Use AlertAction to add a button or other action element to the alert.

Replay preview

Custom Colors

You can customize the alert colors by adding custom classes such as bg-amber-50 dark:bg-amber-950 to the Alert component.

Replay preview

RTL

Alert follows the document direction; text, icon, and action flip together.

Replay preview

API Reference

Alert

PropTypeDefaultDescription
variant"default" | "destructive""default"Visual tone.
classstringExtra classes, merged with cn().

AlertTitle / AlertDescription

PropTypeDefaultDescription
classstringOverride typography or spacing.

AlertAction

PropTypeDefaultDescription
classstringExtra classes. Pins its content to the alert's top-right; the alert reserves trailing space automatically.