Alert

@/components/kamod-ui/alert

Installation

Import Alert parts from `@/components/kamod-ui/alert`.

pnpm add @kamod-ch/ui
import { Alert, AlertAction, AlertDescription, AlertTitle } from "@/components/kamod-ui/alert";

Usage

Put an optional Lucide icon first, then AlertTitle and AlertDescription. Use AlertAction for a corner control.

import { Alert } from "@/components/kamod-ui/alert";
<Alert />
import { Alert, AlertAction, AlertDescription, AlertTitle } from "@/components/kamod-ui/alert"
import { Button } from "@/components/kamod-ui/button";
import { Info } from "lucide-preact";

<Alert>
  <Info />
  <AlertTitle>Heads up!</AlertTitle>
  <AlertDescription>You can add components using the CLI.</AlertDescription>
  <AlertAction>
    <Button variant="outline">Enable</Button>
  </AlertAction>
</Alert>

Basic

Icon, title, and description in a max-width column.

Destructive

Use variant="destructive" for errors and irreversible failures.

Action

AlertAction pins a button (or group) to the top-inline-end; the root adds padding so text does not overlap.

Custom colors

Override surface and border with utilities (e.g. amber) for marketing or billing warnings.

API Reference

Props overview.

Alert

shadcn-compatible `default` and `destructive`, plus Kamod semantic variants (primary, secondary, info, success, warning, error).

PropTypeDefault
variant"default" | "destructive" | "primary" | "secondary" | "info" | "success" | "warning" | "error""default"
classstring-
childrenComponentChildren-

AlertTitle

PropTypeDefault
classstring-

AlertDescription

PropTypeDefault
classstring-

AlertAction

Absolutely positioned at top-end; reserve space with parent padding.

PropTypeDefault
classstring-

Accessibility Notes

Use Alert with clear labels, keyboard-friendly interactions and semantic structure.