Skip to Content
ComponentsAlert

Alert

Displays a callout for user attention.

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

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

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

<Alert> <AlertTitle>Note</AlertTitle> <AlertDescription>This action cannot be undone once confirmed.</AlertDescription> </Alert>
Last updated on