Search documentation

Search components and pages

Alert

Displays a callout for user attention.

01

Installation

Add the alert component with the shadcn CLI.

bash
npx shadcn@latest add https://swiss.ui.unsanity.ai/r/alert.json
02

Usage

tsx
import { Alert } from "@/components/ui/alert"
03

Examples

Destructive

import { TerminalIcon } from "lucide-react"

import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"

<Alert variant="destructive" className="w-80">
  <TerminalIcon />
  <AlertTitle>Error</AlertTitle>
  <AlertDescription>Your session has expired. Please log in again.</AlertDescription>
</Alert>