Ballmac UI home

Badge

A small pill label in four variants with an optional status dot and success, warning and error tones. Style links with badgeVariants().

Newv2.4.0Pro planOverdueDraftChangelog

Installation

$ pnpm dlx shadcn@latest add @ballmac/badge

Usage

import { Badge } from "@/components/ballmac/badge"

The full example is in the Code tab above.

Examples

Status

  • api-gatewayDeployed
  • web-dashboardDegraded
  • billing-workerFailed
  • search-indexerQueued

API reference

PropTypeDefault
asChild

Render the child element (for example a link) with badge styles.

booleanfalse
dot

Show a small leading dot. On by default when `status` is set.

boolean—
variant"default" | "secondary" | "outline" | "destructive""default"
status"neutral" | "success" | "warning" | "error"—

Also accepts the standard attributes of its root element.

Use with AI

Short metadata or status label. Use variant for emphasis, status (neutral | success | warning | error) for state with a coloured dot, and badgeVariants() on an <a> for a link. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Badge (@ballmac/badge) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Status of a deployment, invoice or job
  • Counts, plan names and version tags
  • Small labels on cards and table rows

Not for

  • Clickable filters that toggle (use a toggle or button)
  • Long text (it doesn't wrap)
  • Notifications that need attention (use an alert or toast)

Registry JSON: https://ui.ballmac.com/r/badge.json

Credits

Based on shadcn/ui Badge, adapted by Ballmac. Free to use in personal and commercial projects.

Registry
shadcn/utils