Alert

A callout for displaying important information.

Loading...
Loading code...

Installation

pnpm dlx shadcn@latest add @uitopia/alert

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

Loading...
Loading code...

With Icon and Action Buttons

Loading...
Loading code...

Info Alert

Loading...
Loading code...

Success Alert

Loading...
Loading code...

Warning Alert

Loading...
Loading code...

Error Alert

Loading...
Loading code...

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