Component
Badge
Label counts, statuses, and categories with compact size and variant controls.
Interactive preview
Usage
Import the component entry and start with its smallest complete example.
Import
import { Badge } from "@chitrank2050/monoline-ui/badge"Basic usage
<Badge variant="outline" size="sm">Outline</Badge>
<Badge variant="solid" size="sm">Solid</Badge>
<Badge variant="muted" size="sm">Muted</Badge>
<Badge variant="accent" size="sm">Accent</Badge>Usage guidance
Choose the component for its interaction model and semantics before customizing its appearance.
Badge is for short, static labels such as a category, version, or compact count.
The label is selectable, changes live, or contains enough text to wrap.
Badge is a span with no announcement role. Its text must make sense on its own, and live changes need a separate status mechanism.
This component can render without adding a Monoline client boundary when its children and props are serializable.
API reference
Props, slots, and callbacks available on this component.
Design tokens
Theme variables this component reads for color, spacing, and motion.
Implementation
The source used by the example above, including any state it needs.
import { Badge } from "@chitrank2050/monoline-ui/badge"
export function Badges() {
return (
<div className="flex gap-2">
<Badge variant="solid">Active</Badge>
<Badge variant="outline">Draft</Badge>
<Badge variant="muted">Archived</Badge>
</div>
)
}Related documentation
Compare related components or review the package and theme setup.