Skip to main content
Design System

Alert

Alerts display important messages to users. They can be informational, success, warning, or error messages.

Variants

Alerts support multiple variants to indicate different types of messages.

Default

Success

Destructive

Warning

Dismissible

Alerts can be dismissible with a close button.

Dismissible Alert

Usage

import { Alert, AlertDescription, AlertIcon, AlertTitle, } from "@/components/ui/alert"; export function MyComponent() { return ( <Alert variant="success"> <div className="flex gap-3"> <AlertIcon variant="success" /> <div> <AlertTitle>Success</AlertTitle> <AlertDescription>Operation completed successfully.</AlertDescription> </div> </div> </Alert> ); }

Material 3 Features

  • Color Roles: Uses Material 3 error-container and on-error-container for destructive alerts
  • Surface Container: Uses surface-container-high for background
  • Borders: Subtle borders with opacity based on variant
  • Icons: Contextual icons for each variant type
  • Theme Support: Automatically adapts to light and dark themes