npx shadcn@latest add https://sdk-components.thesqd.com/r/alert.jsonimport { Alert, type AlertVariant } from "@/components/ui/alert";import { Warning as CircleAlertIcon } from "@phosphor-icons/react/ssr";
import { Alert } from "@/components/ui/alert";
export function Example() {
return (
<Alert
variant="brand"
icon={<CircleAlertIcon weight="duotone" />}
title="Heads up"
description="You can add components to your app using the squad-ui CLI."
/>
);
}Alert (single component — pass everything as props)
├── version="v1 | v2" (v1 soft tint · v2 neutral card + accent bar)
├── variant="default | brand | info | success | warning | destructive"
├── icon={<LucideIcon />} (any lucide icon, optional)
├── title={<ReactNode>} (renders into the title slot)
├── description={<ReactNode>} (multi-line / JSX is fine)
└── action={<Button … />} (optional — top-right slot)| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "brand" | "info" | "success" | "warning" | "destructive" | "default" | Visual tone. Drives border, background, text, and dark-mode classes. |
version | "v1" | "v2" | "v2" | Visual treatment. `v2` (default, latest) is the neutral card with a colored left accent bar + colored icon; `v1` is the older soft full-tint callout. Same flat props and colors either way. |
icon | ReactNode | — | Leading icon (typically a Phosphor icon component). |
title | ReactNode | — | Bold heading rendered next to the icon. |
description | ReactNode | — | Body content. Accepts strings or JSX (e.g. lists of links). |
action | ReactNode | — | Optional content pinned to the top-right corner. |
actionButton | AlertActionConfig | — | Async action button rendered vertically-centered on the right edge. Pass `{ label, loadingLabel?, doneLabel?, successMessage?, variant?, onAction? }`. The alert handles idle → loading (Spinner) → done state and fires the optional info toast on resolve. |
className | string | — | Override or extend the resolved variant classes. |