Component

Badge

Small semantic labels for status, categories, and compact metadata.

Preview

DraftSyncedReviewFailedQueued

Installation

Install the package, then import the component and shared stylesheet in your app.

Package install

Install the package when you want components imported from axie-ui.

install
pnpm add axie-ui

Import

code
import "axie-ui/styles.css";import { Badge } from "axie-ui";

Registry install

Use the direct URL when you want shadcn to copy editable source into your app. This works without the official registry and does not install axie-ui.

registry
pnpm dlx shadcn@latest add https://axie.alexi.life/r/badge.json

Copied source import

code
import "@/styles/axie.css";import { Badge } from "@/components/axie/badge";

Prefer @axie/badge? Add the Axie namespace once from the Installation page, then use that shorthand.

Usage

code
import { Badge } from "axie-ui";export function Example() {  return <Badge tone="accent">Synced</Badge>;}

Accessibility

  • Badges should supplement nearby text, not replace it.
  • Avoid communicating critical state with color only.
  • Keep badge labels short so they remain readable at small sizes.

API Reference

PropTypeDefaultDescription
toneneutral | accent | danger | warning | infoneutralControls semantic color treatment.
...propsHTMLAttributes<HTMLSpanElement>-Inline span props.