Badge
<ts-badge> vv0.4.0
The ts-badge component.
Open in Storybook for interactive demos.
Preview
Section titled “Preview”<ts-badge size="md" variant="primary">Content</ts-badge>Properties
Section titled “Properties”| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
dot | dot | boolean | false | Renders the badge as a small dot indicator (content is hidden). |
outline | outline | boolean | false | Renders an outlined style instead of solid. |
pill | pill | boolean | false | Renders the badge with rounded-pill shape. |
size | size | "lg" | "md" | "sm" | "xl" | "xs" | 'md' | The badge’s size. |
variant | variant | "danger" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | 'primary' | The badge’s color variant. |
| Name | Description |
|---|---|
*(default)* | Default slot for badge content. |
CSS Parts
Section titled “CSS Parts”Use ::part() to style internal elements:
| Part | Description |
|---|---|
base | The badge element. |
ts-badge::part(base) { /* your custom styles */}<ts-badge size="md" variant="primary">Content</ts-badge>import { TsBadge } from '@tessera-ui/react';
<TsBadge size="md" variant="primary">Content</TsBadge>