Forms
Navigation & layout
Data display & feedback
Date & time
Browse components
← All components
Badge
Compact status badge with solid and soft variants.
Install
npx shadcn@latest add https://ui.anuragroy.dev/r/badge.jsonPreview
Loading preview…
Installation
Add the component from this site. The shadcn CLI fetches the registry JSON over HTTPS — no named registry submission required.
Terminal
npx shadcn@latest add https://ui.anuragroy.dev/r/badge.jsonGitHub fallback if the website is down:
Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/badge.jsonUsage
Import paths follow your components.json aliases. After install, the default path is @/components/ui/badge.
Import
import { Badge } from "@/components/ui/badge"example.tsx
import { Badge } from "@/components/ui/badge"export function Example() { return ( <> <Badge>Primary</Badge> <Badge variant="secondary">Secondary</Badge> <Badge variant="success">Success</Badge> </> )}API Reference
Badge
| Prop | Type | Default |
|---|---|---|
| variant | "primary" | "secondary" | "success" | "success-soft" | "warning" | "destructive" | "destructive-soft" | "outline" | "soft" | "primary" |
Notes
- Soft success/warning variants use optional `--success` and `--warning` theme tokens.