Alert
Variants
Section titled “Variants”Heads up
You can add components using the CLI.
Error
Your session has expired. Please log in again.
Warning
This action cannot be undone once confirmed.
Success
Your changes have been saved.
alert-variants.tsx
import { Stack } from "@/components/ui/stack"
import { Alert, AlertTitle, AlertDescription } from "@/components/ui/alert"
export function AlertVariants() {
return (
<Stack direction="col" className="gap-3">
<Alert>
<AlertTitle>Heads up</AlertTitle>
<AlertDescription>You can add components using the CLI.</AlertDescription>
</Alert>
<Alert variant="destructive">
<AlertTitle>Error</AlertTitle>
<AlertDescription>Your session has expired. Please log in again.</AlertDescription>
</Alert>
<Alert variant="warning">
<AlertTitle>Warning</AlertTitle>
<AlertDescription>This action cannot be undone once confirmed.</AlertDescription>
</Alert>
<Alert variant="success">
<AlertTitle>Success</AlertTitle>
<AlertDescription>Your changes have been saved.</AlertDescription>
</Alert>
</Stack>
)
}