Badge

A small, read-only label for status, category or freshness, such as Paid, Overdue or Beta. Use a chip when the user can remove the value.

  • vig-badge
Import
import { Badge } from '@vigdx/ui/badge';

Variants

variant picks a soft tone: secondary (default), primary , accent , ghost and the four status colors. Pick the tone by meaning, not decoration.

Draft New Beta Archived Scheduled Paid Pending Overdue

Status dot

dot prefixes the label with a small dot in the badge color, a common pattern for service or record status.

Operational Degraded Outage Maintenance

Borderless

Set bordered to false for flat badges on busy surfaces such as dense tables.

Bordered Borderless Bordered Borderless

Projected content

Without a label the badge renders its projected content, so it can hold inline markup. Badges sit inline with headings and text.

Usage reports Beta

Invoice INV-2041 Due in 3 days

Styling hooks

Internal elements carry a stable data-part and the component's data-scope; both are public API, so removing one is a breaking change. Select a part by both, e.g. [data-scope="badge"][data-part="root"] { … }: the pair stays within this component when kit components nest, and also reaches parts in overlay panels, which render outside the host. State is exposed through aria-* and, where listed, a data-state; literal values are checked by the API gate, values computed from the component's state follow its documented types. Other data-* attributes listed below (such as data-opening while an overlay animates) are API too. See Customizing.

Scope: [data-scope="badge"]

Badge styling hooks
Part Element data-state
root The visible badge. —
dot The status dot ( dot ). —

Accessibility

  • A badge is plain inline text with no role: screen readers read it as part of the surrounding content, so place it where that reading order makes sense.
  • The status dot is decorative (aria-hidden); the label must carry the meaning on its own, never the color alone.
  • If a badge changes while the user is on the page and the change matters, announce it through a live region (for example a toast or role="status" text).
  • Every tone meets WCAG AA text contrast on its tinted fill in light and dark mode.

API

Badge

vig-badge component
Badge props
Name Type Default Description
borderedbooleantrue

Draws the tinted outline; turn it off for flat chips on busy surfaces.

dotbooleanfalse

Renders a small status dot in the current variant color.

labelstring | undefinedundefined
—
variantBadgeVariant'secondary'
—

Are you sure?