Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Shadcn Alert for React and Tailwind

Displays an alert for user attention.

Installation

bunx --bun shadcn@latest add https://kit.dev/r/alert.json

Usage

import {
  Alert,
  AlertDescription,
  AlertTitle,
} from "@/components/ui/alert";
<Alert className="max-w-md">
  <AlertTitle>Heads up!</AlertTitle>
  <AlertDescription>
    You can add icons to alerts to provide visual context and improve user
    experience.
  </AlertDescription>
</Alert>

Demos

Custom Color

Variant Default

Variant Destructive

Variant Info

Variant Success

Variant Warning

With Action

With Icon

API Reference

Alert

div

PropType
AttributeType

AlertTitle

div

PropType
AttributeType

AlertDescription

div

PropType
AttributeType

AlertAction

div

PropType
AttributeType