Alert
Displays a callout for user attention.
Heads up
You can add components to your app using the CLI.
Usage
import { Alert, AlertTitle, AlertDescription } from "@/components/ui/alert"<Alert>
<AlertTitle>Heads up</AlertTitle>
<AlertDescription>You can add components using the CLI.</AlertDescription>
</Alert>Examples
Default
Information
Your session will expire in 30 minutes.
import { Info } from "lucide-react"
<Alert>
<Info className="h-4 w-4" />
<AlertTitle>Information</AlertTitle>
<AlertDescription>Your session will expire in 30 minutes.</AlertDescription>
</Alert>Destructive
Error
Your session has expired. Please log in again.
import { TriangleAlert } from "lucide-react"
<Alert variant="destructive">
<TriangleAlert className="h-4 w-4" />
<AlertTitle>Error</AlertTitle>
<AlertDescription>Your session has expired. Please log in again.</AlertDescription>
</Alert>Without icon
Note
This action cannot be undone once confirmed.
<Alert>
<AlertTitle>Note</AlertTitle>
<AlertDescription>This action cannot be undone once confirmed.</AlertDescription>
</Alert>Last updated on