Skip to content
Hazine

Status Badge

Small pill that labels the state of a record in neutral, info, success, warning and destructive tones. Use it in tables and headers, always with a word and optionally an icon.

How it differs. The baseline pill: a text label with an optional leading icon in soft, solid and outline appearances, with no dot, count or action.

Install

pnpm dlx shadcn@latest add @hazine/status-badge

Adds 1 file, 1 package (class-variance-authority), and the success, warning, and info tokens.

First time? Add the registry to components.json
{
  "registries": {
    "@hazine": "https://api.hazine.dev/r/{name}.json"
  }
}

Needed once per project. Items resolve each other through the @hazine namespace.

Props1

icon
React.ReactNode
Decorative icon before the label, sized by the caller (size-3.5 fits).

Also accepts every prop of React.ComponentProps<"span"> and VariantProps<typeof statusBadgeVariants>.

Accessibility

Pattern
Landmarks and headings
Keyboard
Nothing to operate. The item has no focusable parts.
Screen reader

A span with a text label. The status is carried by the word, the icon is decorative and hidden from assistive technology.

Reduced motion
No motion.
Checked
Not checked yet. Automated results appear here once CI has run.

Dependencies1

  • class-variance-authority

Filled chips are registry items the CLI adds for you. Outlined chips are npm packages.

Tokens shipped6

  • --success
  • --success-foreground
  • --warning
  • --warning-foreground
  • --info
  • --info-foreground

Added to your stylesheet in light and dark, unless you already define them.

More in Feedback and Status