npx shadcn@latest add https://sdk-components.thesqd.com/r/badge.jsonimport { Badge } from "@/components/ui/badge";
export function Example() {
return (
<div className="flex flex-wrap items-center gap-3">
<Badge>New</Badge>
<Badge type="status" color="success">Completed</Badge>
<Badge type="outline" onRemove={() => {}}>Removable</Badge>
</div>
);
}Badge (single component — pass content + props)
├── type="pill-color | solid | fancy | outline | ghost | secondary | link | status | tag"
├── color="brand | indigo | … | success | warning | info | …" (tinted types)
├── size="xxs | xs | sm | default | lg"
├── (optional) leading swatch — driven by `swatchClassName`
├── (optional) leading status dot — automatic when `type="status"`
├── children — your label / count / icon
└── (optional) trailing × button — when `onRemove` is setBadge
| Prop | Type | Default | Description |
|---|---|---|---|
type | "pill-color" | "solid" | "fancy" | "outline" | "ghost" | "secondary" | "link" | "status" | "tag" | "pill-color" | Visual treatment. `status` adds a leading colored dot using `color`; `solid` is a saturated fill; `fancy` is the glossy radial-wash pill. |
color | "brand" | "indigo" | "coral" | "purple" | "amber" | "magenta" | "lavender" | "lilac" | "pink" | "cream" | "blush" | "peach" | "destructive" | "success" | "warning" | "info" | "muted" | "emerald" | "sky" | "fuchsia" | "brand" | Palette token. Drives bg/border/text when type=`pill-color`, `solid`, `status`, or `fancy`. |
size | "xxs" | "xs" | "sm" | "default" | "lg" | "default" | Heights mirror Button: xxs = h-4 (micro pill), xs = h-5, sm = h-6, default = h-8, lg = h-10. |
swatchClassName | string | — | Tailwind bg-* class for an optional leading 2.5×2.5 swatch dot. |
onRemove | () => void | — | When set, renders a trailing × button. Pair with controlled state in the parent. |
className | string | — | Override or extend the resolved type/color classes. |
variant | string | — | Deprecated — kept for back-compat. Mapped through to (type, color). |