Badge

Small pill label in default, secondary, destructive, outline, ghost and link styles.

Installation

pnpm dlx shadcn@latest add @ward/badge

Add the Ward registry to components.json once:

"registries": {
  "@ward": "https://ward.so/r/{name}.json"
}

Or install from the URL with no configuration: npx shadcn@latest add https://ward.so/r/badge.json

Usage

import { Badge } from "@/components/ui/badge";
<Badge>New</Badge>
<Badge variant="secondary">Draft</Badge>
<Badge variant="outline">Website</Badge>
<Badge asChild variant="link"><a href="/changelog">What changed</a></Badge>

Props

PropTypeDefaultDescription
variant"default" | "secondary" | "destructive" | "outline" | "ghost" | "link""default"Visual style.
asChildbooleanfalseRender the child element (for example a link) with badge styles; links also gain hover states.

Ward · Version 1.0.0 · Registry manifest