@xsolla/xui-badge
v0.99.0
Published
A small circular indicator for displaying counts, status dots, or short labels.
Readme
@xsolla/xui-badge
A small circular indicator for displaying counts, status dots, or short labels.
Installation
yarn add @xsolla/xui-badgeUsage
import { Badge } from "@xsolla/xui-badge";
<Badge tone="alert" size="md">9</Badge>
{/* Dot-only (no content) */}
<Badge tone="success" size="sm" />Props
Badge
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| tone | "primary" \| "secondary" \| "brand" \| "brandExtra" \| "success" \| "warning" \| "alert" \| "neutral" | "alert" | Colour tone |
| size | "xl" \| "lg" \| "md" \| "sm" \| "xs" | "md" | Badge size; "sm" and "xs" render as dot-only |
| icon | ReactNode | — | Icon rendered inside the badge (not available at "sm"/"xs") |
| showStroke | boolean | false | Adds a 1px border to separate the badge from its background |
