Search

Search documentation

Alert

Displays a callout for user attention.

Installation

›pnpm dlx shadcn@latest add @evolphin/alert

Usage

import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
<Alert>
  <Terminal className="h-4 w-4" />
  <AlertTitle>Heads up!</AlertTitle>
  <AlertDescription>
    You can add components to your app using the cli.
  </AlertDescription>
</Alert>

Type Definitions

interface AlertProps {
  /** The visual style of the alert */
  variant?: "default" | "destructive";
AlertProps.variant?: "default" | "destructive" | undefined

The visual style of the alert

}

Examples

Default

Destructive

Use for critical errors or warnings.

API Reference

Alert

PropTypeDefaultDescription
variant"default" | "destructive""default"The visual style of the alert
classNamestring-Additional CSS classes

AlertTitle

PropTypeDefaultDescription
classNamestring-Additional CSS classes

AlertDescription

PropTypeDefaultDescription
classNamestring-Additional CSS classes

Accessibility

  • Role: alert role is applied to the root element.

On this page