Alert

Ready

Alert banners for important messages and notifications

Alert Variants

AI, success, error, warning, and info alerts

Alert without Title

Simple alerts with description only

Dismissible Alerts

Alerts with close button

Installation

No additional dependencies required

Alert component uses only Tailwind CSS - no external dependencies needed.

Usage

Basic implementation example

import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'
import { CheckCircle2 } from 'lucide-react'

export default function Example() {
  return (
    <Alert variant="success">
      <CheckCircle2 className="h-4 w-4" />
      <AlertTitle>Success</AlertTitle>
      <AlertDescription>
        Your changes have been saved.
      </AlertDescription>
    </Alert>
  )
}

Props

Alert component props

PropTypeDefaultDescription
variant'default' | 'ai' | 'info' | 'success' | 'error' | 'warning''default'Alert variant style
classNamestring-Additional CSS classes

Features

Built-in functionality

  • 6 variants - AI, default, info, success, error, warning
  • AI variant - Gradient background with Lightbulb icon
  • Icon support - Default semantic icons or custom icons
  • Dismissible - Optional close button with onClose handler
  • Flexible content - Title and/or description
  • Accessible - Semantic HTML with ARIA roles
  • Dark mode - Full dark mode support
  • 8px border radius - Consistent with Eidetic design