Components/Alert

Alert

Displays a callout for user attention with optional icon, title, description, and dismiss action.


Installation

npx ajaxui add alert

Usage

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

Props

PropTypeDefault
variant"default" | "info" | "success" | "warning" | "error""default"
iconReactNode
onClose() => void