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.
Usage
Import the parts you need from the component's folder.
ts
import {
Alert,
AlertTitle,
AlertDescription,
AlertAction,
} from "@/components/ui/alert";Basic
A basic alert with an icon, title and description.
Destructive
Use variant="destructive" to create a destructive alert.
Action
Use AlertAction to add a button or other action element to the alert.
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.
RTL
Alert follows the document direction; text, icon, and action flip together.