Badge
A small label for a status, a count, or a category.
When to use it
Use Badge to label the state of something nearby: Published, Draft, Beta. Keep it to a word or two.
Save color for status that matters. Most badges can stay neutral.
Alert
Stays on the page.
Warnings and errors about this page.
BadgeThis page
Labels a status.
Published, Draft, and Beta.
Empty
Nothing here yet.
Tip: pressโNfrom anywhere to start a document.
First runs and empty searches.
How it behaves
Renders a span by default. Preserves shadcn render composition and default, secondary, destructive, outline, ghost, and link variants; JZB adds success and accent.
The default is a quiet bordered label with tight corners. Success and accent use light tints and subtle borders; secondary remains a filled alternative. Shared label-sm typography keeps badges compact.
Use words as well as color to communicate status. Native span props are forwarded.
Build it
Add it with the shadcn CLI:
1pnpm dlx shadcn@latest add https://jzbui.com/r/badge.jsonA complete example. Change the values to fit your product:
12345import { Badge } from "@/components/ui/badge"
<Badge>Current</Badge><Badge variant="accent">Trial</Badge><Badge variant="success">Published</Badge>The full source is yours to edit once installed: