8.4k

Alert

A callout for displaying important information.

Installation

pnpm dlx shadcn@latest add https://coss.com/ui/r/alert.json

Usage

import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
<Alert>
  <AlertTitle>Heads up!</AlertTitle>
  <AlertDescription>
    You can add components and dependencies to your app using the cli.
  </AlertDescription>
</Alert>

Examples

With Icon

With Icon and Action Buttons

Info Alert

Success Alert

Warning Alert

Error Alert

Comparing with shadcn

New Variants

We've added new colored variants for better semantic meaning:

VariantDescription
infoDisplays an info alert (blue)
successDisplays a success alert (green)
warningDisplays a warning alert (yellow)
errorDisplays a error alert (red)

Ensure you have the following variables imported in your CSS file:

  • --destructive-foreground
  • --info
  • --info-foreground
  • --success
  • --success-foreground
  • --warning
  • --warning-foreground

coss.com ui

Built by and for the team of Cal.com, Inc. — the leading commercial open source company (“coss”).