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-uiImport
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.jsonCopied 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
| Prop | Type | Default | Description |
|---|---|---|---|
| tone | neutral | accent | danger | warning | info | neutral | Controls semantic color treatment. |
| ...props | HTMLAttributes<HTMLSpanElement> | - | Inline span props. |