UILab

Alert

Displays a callout for user attention.

"use client"

import {
  Alert,
  AlertDescription,

Usage

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

Examples

Basic

A basic alert with an icon, title and description.

"use client"

import { Alert, AlertDescription, AlertTitle } from "uilab-core"
import { InfoIcon } from "lucide-react"

Destructive

Use variant="destructive" to create a destructive alert.

"use client"

import { Alert, AlertDescription, AlertTitle } from "uilab-core"
import { AlertCircleIcon } from "lucide-react"

Action

Use AlertAction to add a button or other action element to the alert.

import {
  Alert,
  AlertAction,
  AlertDescription,
  AlertTitle,

Custom color

You can customize the alert colors by adding custom classes such as bg-amber-50 dark:bg-amber-950 to the Alert component.

"use client"

import { Alert, AlertDescription, AlertTitle } from "uilab-core"
import { AlertTriangleIcon } from "lucide-react"

On this page