import { Badge, Text } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-100">
<Text weight="medium">Invoice INV-2026-0318</Text>
<Badge tone="success">Paid</Badge>
</Stack>
);
}import { Badge, BadgeAnchor } from "@senvenli/react/display";Examples
Tones
One meaning per tone, across the whole product.import { Badge } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-100">
<Badge>Draft</Badge>
<Badge tone="information">In progress</Badge>
<Badge tone="brand">Featured</Badge>
<Badge tone="success">Completed</Badge>
<Badge tone="warning">Payment pending</Badge>
<Badge tone="danger">Canceled</Badge>
</Stack>
);
}Bold
`variant="bold"` for the one status on the screen that needs attention now.import { Badge } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-100">
<Badge tone="danger" variant="bold">
Overdue
</Badge>
<Badge tone="warning">Payment pending</Badge>
<Badge tone="success">Paid</Badge>
</Stack>
);
}With a dot
A dot in the pill marks a live state.import { Badge } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-100">
<Badge tone="success" hasDot>
Online
</Badge>
<Badge tone="information" hasDot>
Syncing
</Badge>
</Stack>
);
}Dot: a live state
`variant="dot"`: a dot and a word, for a system state (connected, syncing).import { Badge } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-300">
<Badge variant="dot" tone="success">Connected</Badge>
<Badge variant="dot" tone="information">Syncing</Badge>
<Badge variant="dot" tone="warning">Slow connection</Badge>
<Badge variant="dot" tone="danger">Offline</Badge>
<Badge variant="dot">Not set up</Badge>
</Stack>
);
}Dot and live
`isLive` adds a halo for a state that is active right now.import { Text } from "@senvenli/react/display";
import { Badge } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-200" justify="between">
<Text weight="medium">Payments webhook</Text>
<Badge variant="dot" tone="success" isLive>Receiving events</Badge>
</Stack>
);
}Dot without a word
Only where a visible word is impossible; `aria-label` names the state.import { Text } from "@senvenli/react/display";
import { Badge } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";
const INTEGRATIONS = [
{ name: "Accounting", tone: "success", state: "Connected" },
{ name: "Email", tone: "warning", state: "Slow connection" },
{ name: "Calendar", tone: "danger", state: "Offline" },
] as const;
export default function Example() {
return (
<Stack space="space-100">
{INTEGRATIONS.map((integration) => (
<Stack direction="horizontal" key={integration.name} space="space-100">
<Badge variant="dot" tone={integration.tone} aria-label={integration.state} />
<Text>{integration.name}</Text>
</Stack>
))}
</Stack>
);
}A count beside a label
`variant="count"`: nothing renders at zero; above `max` it reads "99+".import { Badge, Text } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-300">
<Stack direction="horizontal" space="space-075">
<Text>Open orders</Text>
<Badge variant="count" value={12} />
</Stack>
<Stack direction="horizontal" space="space-075">
<Text>Messages</Text>
<Badge variant="count" value={128} />
</Stack>
</Stack>
);
}Count tones
Neutral by default; danger only for counts that need action now.import { Badge, Text } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-300">
<Stack direction="horizontal" space="space-075">
<Text>Drafts</Text>
<Badge variant="count" value={4} />
</Stack>
<Stack direction="horizontal" space="space-075">
<Text>New customers</Text>
<Badge variant="count" value={7} tone="brand" />
</Stack>
<Stack direction="horizontal" space="space-075">
<Text>Overdue invoices</Text>
<Badge variant="count" value={2} tone="danger" />
</Stack>
<Stack direction="horizontal" space="space-075">
<Text>Archived</Text>
<Badge variant="count" value={31} tone="inverse" />
</Stack>
</Stack>
);
}A count on an icon
The badge is hidden from screen readers, so the button's name carries the count.import { Button } from "@senvenli/react/action";
import { Badge, BadgeAnchor } from "@senvenli/react/display";
export default function Example() {
return (
<BadgeAnchor>
{/* On an icon the cap is 9, and the label says what the badge shows. */}
<Button iconOnly iconBefore="bell" aria-label="Notifications, 9+ unread" />
<Badge variant="count" value={12} tone="brand" />
</BadgeAnchor>
);
}Unread dot
`variant="count"` with no `value`: a marker without a number; the text beside it says what is new.import { Badge, Text } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-075">
<Badge variant="count" />
<Text>New comments on Project Atlas</Text>
</Stack>
);
}A code: Beside a country's name
The code marks the country without a flag; the name beside it is what gets read.import { Badge, Text } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";
const COUNTRIES = [
{ code: "DE", name: "Germany" },
{ code: "US", name: "United States" },
{ code: "JP", name: "Japan" },
];
export default function Example() {
return (
<Stack space="space-100">
{COUNTRIES.map((country) => (
<Stack direction="horizontal" key={country.code} space="space-100">
<Badge>{country.code}</Badge>
<Text>{country.name}</Text>
</Stack>
))}
</Stack>
);
}A code: Standing alone
Without the name beside it, a wrapper gives the chip its accessible name.import { Badge, Text } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-100">
<Text>Ships from</Text>
<span role="img" aria-label="Germany">
<Badge>DE</Badge>
</span>
</Stack>
);
}Guidelines
When to use it
- Showing the state of an item: draft, paid, overdue.
- Showing how many items need attention.
- Marking a country or language next to its name.
Use something else when
Do and avoid
- The word carries the meaning, never the color alone; use sentence case.
- Use the bold appearance sparingly, for the one status that matters most.
- Use
dangeronly for counts that need action now.
Accessibility
Built in
- Text meets WCAG AA in both appearances.
- Counts above
maxshow as "max+". - On an icon the badge is hidden; the control's label must say the count.
- Hidden from screen readers when the name is next to it.
You provide
- A status word that makes sense without color.
- The count in the control's accessible name when the badge sits on an icon.
- The name beside it.
API reference
Badge
| Prop | Type | Default | Description |
|---|---|---|---|
tone | Tone | BadgeCountTone | – | One meaning per tone: information (Approved, In progress) · brand (Featured) · success (Completed, Available, Paid) · warning (Payment pending, Under review) · danger (Canceled, Failed, Overdue) · neutral (Draft, Inactive). |
variant | "bold" | "dot" | "subtle" | "count" | – |
|
hasDot | boolean | – | A 6px dot inside a pill (subtle or bold), for live states. |
radius | ComponentRadius | – | Pills only ( |
isLive | boolean | – |
|
children | React.ReactNode | – | The status word, sentence case ("Payment pending"); the word carries the meaning, never the colour. |
aria-label | string | – |
|
value | number | – | The count; nothing renders at 0. Left out, an 8px unread marker without a number, hidden from screen readers, so the text or label next to it says "new". |
max | number | – | Above it shows "max+"; default 99, or 9 on an icon. |
toneTone | BadgeCountToneOne meaning per tone: information (Approved, In progress) · brand (Featured) · success (Completed, Available, Paid) · warning (Payment pending, Under review) · danger (Canceled, Failed, Overdue) · neutral (Draft, Inactive).
variant"bold" | "dot" | "subtle" | "count"subtle(default): the status of a record in a pill.bold: the one status on the screen that needs attention now.dot: a dot and the word, for a live system state (online, syncing).hasDotbooleanA 6px dot inside a pill (subtle or bold), for live states.
dotalways has its dot.radiusComponentRadiusPills only (
subtle,bold): corner radius,nonetofull; the design's small step (or the provider's default) otherwise.isLivebooleandotonly: a 3px halo for a state that is active right now (connected, syncing).childrenReact.ReactNodeThe status word, sentence case ("Payment pending"); the word carries the meaning, never the colour.
aria-labelstringdotonly, where a visible word is impossible (a dense table cell with its own column header).valuenumberThe count; nothing renders at 0. Left out, an 8px unread marker without a number, hidden from screen readers, so the text or label next to it says "new".
maxnumberAbove it shows "max+"; default 99, or 9 on an icon.
BadgeAnchor
| Prop | Type | Default | Description |
|---|---|---|---|
childrenRequired | React.ReactNode | – |
childrenRequiredReact.ReactNode