Badge
Small label for status, counts and categories in filled, soft, outlined and inverted styles.
Installation
bun add @xerobi/ui
import { Badge } from "@xerobi/ui/badge"This component is client-side. In Astro, hydrate it with a client directive.
Examples
Soft
BlueGreenOrangeNeutralRed
import { Badge } from "@xerobi/ui/badge"
export function BadgeSoft() {
return (
<div className="flex flex-wrap gap-2">
<Badge variant="soft" color="primary">Blue</Badge>
<Badge variant="soft" color="success">Green</Badge>
<Badge variant="soft" color="warning">Orange</Badge>
<Badge variant="soft" color="default">Neutral</Badge>
<Badge variant="soft" color="error">Red</Badge>
</div>
)
}Filled and outlined
PrimaryOutlinedOutline
import { Badge } from "@xerobi/ui/badge"
export function BadgeFilled() {
return (
<div className="flex flex-wrap gap-2">
<Badge variant="filled" color="primary">Primary</Badge>
<Badge variant="outlined" color="primary">Outlined</Badge>
<Badge variant="outline">Outline</Badge>
</div>
)
}Variants
| variant | default, secondary, destructive, outline, ghost, link, filled, soft, outlined, inverted |
API reference
Badge
| Prop | Type | Description |
|---|---|---|
| color | "default" | "info" | "success" | "warning" | "secondary" | "primary" | "error" | Colour for the filled / soft / outlined / inverted variants. |
| variant | "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "soft" | "filled" | "outlined" | "inverted" | |
| disabled | boolean |