Components/Alert
Alert
Displays a callout for user attention with optional icon, title, description, and dismiss action.
Heads up!
You can add components to your app using the CLI.
Installation
npx ajaxui add alertUsage
import { Alert, AlertTitle, AlertDescription } from "@/components/ui/alert"
export default function App() {
return (
<Alert variant="success">
<AlertTitle>Saved</AlertTitle>
<AlertDescription>Your changes have been saved.</AlertDescription>
</Alert>
)
}Variants
Info
A new version is available.
Success
Your changes have been saved.
Warning
Your session is about to expire.
Error
Something went wrong.
Props
| Prop | Type | Default |
|---|---|---|
| variant | "default" | "info" | "success" | "warning" | "error" | "default" |
| icon | ReactNode | — |
| onClose | () => void | — |