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.

Dark previewReplay preview

Basic

A basic alert with an icon, title and description.

Dark previewReplay preview

Destructive

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

Dark previewReplay preview

Action

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

Dark previewReplay 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.

Dark previewReplay preview

RTL

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

Dark previewReplay preview

API Reference

Alert

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

AlertTitle / AlertDescription

PropTypeDefaultDescription
classstring—Override typography or spacing.

AlertAction

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