Alert

Displays a callout for user attention.

Installation

npx kanpeki-ui@latest add alert

Usage

Single import

import { Alert } from "~/components/ui/alert";
import { Icons } from "~/components/ui/icons";
<Alert.Root>
  <Icons.Terminal className="size-4" />
  <Alert.Title>Heads up!</Alert.Title>
  <Alert.Description>
    You can add components and dependencies to your app using the cli.
  </Alert.Description>
</Alert.Root>

Multiple imports

import { AlertRoot, AlertDescription, AlertTitle } from "~/components/ui/alert";
import { Icons } from "~/components/ui/icons";
<AlertRoot>
  <Icons.Terminal className="size-4" />
  <AlertTitle>Heads up!</AlertTitle>
  <AlertDescription>
    You can add components and dependencies to your app using the cli.
  </AlertDescription>
</AlertRoot>

Examples

Default

Warning

Destructive

API Reference

PropTypeDefaultDescription
variant"default" | "destructive" | "warning""default"The visual style of the alert.