Data Display

Badge

Compact non-interactive label that annotates an adjacent element with a short status, count, or category.

import { Badge } from '@lostgradient/cinder';
billinglabelindicatorsubscription
01

Overview

Reference usage

A small inline label for status, category, or count display.

Use Badge for a status or a short tag only: an attached count, a status word, a compact annotation. Use Chip mode="display" when the item is an issue label or tag. Label and value metadata for a record (an owner, a created date, a price) is not a row of badges: put it in a DescriptionList, or a KeyFacts row for a few typed facts.

A badge belongs with the metadata in a row's content column and never in its trailing action column, so it cannot change where an action button lands (see StackedListItem). Show a status only when it is actionable, and never beside a button that says the same thing.

Pass appearance="outlined" to add a status-colored edge around the tinted fill.

Usage

svelte
<script lang="ts">
  import { Badge } from '@lostgradient/cinder';
</script>

<Badge variant="success">Published</Badge>
Live preview

Badge sizes

Extra small Small Medium

02

When to use

Use when
  • Annotating a value with a short status word like "new" or "beta".
  • Displaying a numeric count next to an icon or title.
  • Displaying the billing state of a subscription in a dashboard, invoice list, or account settings page.
  • Annotating a plan name, customer row, or invoice line with its current payment lifecycle state.
Avoid when
  • The label must be interactive or removable — use chip instead.
  • Showing only a colored dot for presence — use status-dot instead.
  • Showing label and value metadata for a record, such as an owner, a date or a price — use description-list instead.
03

Examples

Badge sizes

Extra small, small, and medium sizes.

Badge variants

All five semantic variant styles.

04

Props

Props for badge
Name
Type
Default
Description
variant 'neutral''success''warning''danger''info''accent' 'neutral'
appearance 'soft' | 'outlined' 'soft' Controls whether the badge draws a visible outline around its tinted fill.
size 'xs' | 'sm' | 'md' 'md'
monospace boolean false Render the badge label in a monospace font.
truncate boolean false Keeps the badge within the width it is given and ends a long label with an ellipsis, with the full label in a tooltip on hover and focus, for a value of any length such as a tag.
subscriptionState discriminated-union Render a standardized subscription lifecycle badge without hand-wiring tone, icon, and label.
severity 'info''low''medium''high''critical'
children snippet Required badge content unless subscriptionState is provided; optional content override for the subscription preset label.