Loading...
Loading...
The Alert component displays important messages to users with different variants for different types of information (info, success, warning, error).
import { Alert, AlertTitle, AlertDescription } from '@/components/ui/alert';
import { AlertCircle, CheckCircle2 } from 'lucide-react';
// Basic alert
<Alert>
<AlertCircle className="h-4 w-4" />
<AlertTitle>Title</AlertTitle>
<AlertDescription>
Alert description text
</AlertDescription>
</Alert>
// Success alert
<Alert className="bg-green-50 border-green-200">
<CheckCircle2 className="h-4 w-4" />
<AlertTitle>Success</AlertTitle>
<AlertDescription>Operation completed</AlertDescription>
</Alert>
// Destructive alert
<Alert variant="destructive">
<AlertCircle className="h-4 w-4" />
<AlertTitle>Error</AlertTitle>
<AlertDescription>Something went wrong</AlertDescription>
</Alert>