Alert

A banner-style alert component for important messages

A banner-style alert component built with Tailwind CSS and class-variance-authority. Use it for important notices, errors, or warnings.

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

export default function Example() {
  return (
    <Alert>
      <AlertTitle>Heads up!</AlertTitle>
      <AlertDescription>
        You can use this component to highlight important information.
      </AlertDescription>
    </Alert>
  );
}

Installation

bash
liminal add alert

Usage

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

export default function Example() {
  return (
    <Alert>
      <AlertTitle>Heads up!</AlertTitle>
      <AlertDescription>
        You can use this component to highlight important information.
      </AlertDescription>
    </Alert>
  );
}

Examples

Variants

<Alert variant="default">
  <AlertTitle>Default alert</AlertTitle>
  <AlertDescription>Neutral alert using your theme colors.</AlertDescription>
</Alert>
<Alert variant="destructive">
  <AlertTitle>Error</AlertTitle>
  <AlertDescription>Something went wrong. Please try again.</AlertDescription>
</Alert>

API

PropTypeDefaultDescription
variant"default" | "destructive""default"Visual style. Use destructive for errors or critical messages.