Alert
A callout for displaying important information.
Loading...
Loading code...
Installation
Usage
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"<Alert>
<AlertTitle>Heads up!</AlertTitle>
<AlertDescription>
You can add components and dependencies to your app using the cli.
</AlertDescription>
</Alert>Examples
With Icon
Loading...
Loading code...
With Icon and Action Buttons
Loading...
Loading code...
Info Alert
Loading...
Loading code...
Success Alert
Loading...
Loading code...
Warning Alert
Loading...
Loading code...
Error Alert
Loading...
Loading code...
Comparing with shadcn
New Variants
We've added new colored variants for better semantic meaning:
| Variant | Description |
|---|---|
info | Displays an info alert (blue) |
success | Displays a success alert (green) |
warning | Displays a warning alert (yellow) |
error | Displays a error alert (red) |
Ensure you have the following variables imported in your CSS file:
--destructive-foreground--info--info-foreground--success--success-foreground--warning--warning-foreground