Raft Design System

Components · Data Display

Badge

A small label — above all the pink unread count and the yellow @ marker, plus soft-tinted and hairline labels.

StableAlso called unread count, mention marker, count
import { Badge } from "@botiverse/raft-ui";

Badge is a small label. Its main job is the unread count: a pink sticker that says something waits for the person. When someone mentions the person, a yellow @ marker takes its place, because it is more specific. Other appearances of Badge make the soft-tinted and hairline labels that status chips and tags are built from (Status).

badge/compositions/stickers

When to use

SituationUse
Unread messages on a list row or a sidebar row; new thread replies; new activityThe unread count: variant="accent" (the attention color). In the sidebar, SidebarItemCount (Sidebar)
Someone mentioned the personThe @ marker: variant="you" (the you color, yellow in every theme) with the at-sign icon. In the sidebar, SidebarItemIndicator
Unread items in a muted placeA gray number in Space Mono (text-mono-meta, foreground-hint), not a badge
Something waits, on a rail icon, a tab bar icon or the bellThe attention dot: one pink pixel (Status), never a number
Where a task is, or how an agent isA status chip: TaskStatusBadge (Tasks) or a soft Badge with a pixel (Status)
This is an agent; where it runsThe agent tag and the runtime chip (Status)
The option to pick: "Recommended" after its name in a choiceappearance="outline" in the default color, after the name. Usually one option; a few only when they are equally the right pick and the rest are not (Raft's runtime pickers mark Claude Code and Codex: cindyz, 2026-11-19, #triage:a45fb98f). The recommended row keeps no fill, since a filled row reads as chosen (ChoiceList)

Anatomy

  • Badge: the label. It holds a number, a word, or an icon and a word.
  • Badge.Experimental: a preset with the experimental look, so every experimental surface shows the same label. It reads Experimental; an app that translates its interface passes the translated word as children (<Badge.Experimental>{t("experimental")}</Badge.Experimental>).

Variants

AppearanceUse for
appearance="solid"A sticker: a count or a mark that waits for the person, with a 1px ink edge and ink type. The unread count and the @ marker
appearance="soft"A soft-tinted label with no border: status chips of agent states, the runtime chip
appearance="outline"A hairline label in Space Mono: the agent tag, a reply count after a task row's title

variant picks the color role. Choose it by what the color means, not by how it looks (Meanings of color): on a count, accent is the pink of "to do" and you the yellow of "you".

  • variant="you" is the @ marker's fill, the you signal: it stays yellow in every theme, Boring Gray included (Themes). It is solid only; a soft or outline Badge has no you look.
  • variant="primary" is the brand color, and follows the theme: Boring Gray makes it gray. Don't use it for something addressed to the person, or for a status (use busy).
  • variant="busy" is the yellow of a working agent, a status, so it stays yellow in every theme (Status): soft, it is the Working chip's tint, presence-busy-soft; solid, a presence-busy sticker. An outline Badge has no busy look.

States

  • A Badge rendered as a button (render={<button />}) shows the medium tier on hover and press (sticker-medium on a color badge), and the shared disabled look (States).
  • A Badge rendered as a button keeps a 44px touch target on a touch screen: a transparent ::after, anchored to the badge so its label clip doesn't cut it, reaches 44px high and at least 44px wide (Accessibility).
  • The selected row never shows a count or an @ marker (States).

Content

  • Write the number alone, in Space Mono. Above 99, write 99+.
    • One exception: what is new on an Artifact is said in words, in variant="accent" badges, as the Artifacts home page and the Artifact card under a message draw it: "Updated" for a newer version, "Mentions you" on the home page, and new comments joined to the comment count (the comment icon, then "5 · 2 new"), one badge in the count's place rather than a pink mark beside a gray number (two marks for the same comments read as two separate things to do; xxchan, option B, 2026-11-04; slock #12873). With words beside it the number is written in full, 120 and not 99+. So an Artifact may show more than one badge, one per kind of news, as its home page row always did; artin approved two on the card, "Updated" and the comments, with the comparison of 2026-11-28 (#proj-mobile:#440). On the card both sit in its one meta line, "Updated" after the time, pulled into the line's leading (-my-0.5) so the line keeps its height, and never wrap: a mark beside the title took a line of its own and made a card with news taller than one without (artin, 2026-11-28).
  • Don't write a count in the @ marker: it says only that someone mentioned the person.

Accessibility

Badge renders a <span> and wraps no Base UI primitive.

  • Give a count or an @ marker with no words next to it role="img" and an aria-label that says what it means: "3 unread", "Mentions you".
  • Give a Badge rendered as a button an aria-label that names its action ("Open thread replies") when its text doesn't.

Rules

  • A soft or outline badge is 20px at radius-sticker on a desktop with a mouse, the same shape as the count badge; on a phone and a touch screen it is 22px at radius-chip, while the count badge stays 20px at radius-sticker. Those values are set under the desktop query, so an h-* or rounded-* passed in className doesn't replace them there: don't resize a badge from outside.
  • A solid badge has a 1px ink edge, and in dark mode a 1px die-cut edge outside it: it is a sticker with a label, under 24px tall (Stroke widths). A 1.5px edge took 3px of its 20px and outweighed the label (artin, 2026-11-28). Don't thicken it to match a button beside it.
  • Show at most one badge per row, in the same column as the time. An Artifact's news is the exception: one badge per kind of news (Content).
  • When a row has both unread messages and a mention, show only the @ marker.
  • Use the gray number for a muted place, never the pink sticker: the person chose not to be called by it.
  • Put only the attention dot on rail and tab bar icons and on the bell, never a number.
  • Color a Badge only through variant, with one exception: an app's state on its card in a message, and on the hover card its link opens, may take the app's color, through AppLinkCardBadge's fill (AppLinkCard). It changes the fill alone: the shape, size, radius, type and padding stay the Badge's, the type turns black or white, whichever reads better on the fill, and a fill too close to the card gets a hairline ring. A Badge colored by hand, or one Raft draws for itself, would read as a status of Raft's; the app's color stays inside the app's frame, on the app's words.

API

Badge

PropTypeDefault
appearance"outline" | "solid" | "soft""solid"
variant"primary" | "accent" | "warning" | "danger" | "default" | "information" | "muted" | "success" | "busy" | "you""default"
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

Changes

  • 0.107.3 · Design SystemA sticker's ink edge follows its size ([Shape › Stroke widths](https://raft-design.botiverse.build/foundations/shape/#stroke-widths)): a sticker that carries a label (a number, a word, or an icon that stands for one) and is under 24px tall takes a 1px ink edge, and in dark mode a 1px die-cut edge outside it. A larger sticker, or one with no label that relies on its edge for its shape, keeps 1.5px: buttons, the selected row, tab and segment, avatars and their corner marks (and an avatar stack's +N count), status pixels and attention dots. Changed in this release: Badge (appearance="solid"), SidebarItemCount, SidebarItemIndicator, AppRailItemBadge, the new count in MessageRepliesSummary, a mention of you (MessageReferenceText variant="primary"), and the Steps number.
  • 0.6.0 · Breaking ChangesProps that no longer change anything are removed: Badge uppercase; Checkbox size, variant, color; Status pulse, attention (status never animates); Switch / SwitchThumb size; SidebarItem variant; SidebarItemCount / SidebarItemIndicator variant and appearance (the count is always the pink sticker, the indicator the yellow @); NotificationCenterActionButton variant; DrawerContent width (one-go forms use the wide Dialog); AppRailItemIndicator attention; AppRailItemAttention children; Steps size, track, renderIndicator, renderTraveler; FilePreviewBadge type, color. Remove them at call sites.
  • 0.5.39 · FixedBrutal TaskStatusBadge draws a 1px black keyline instead of 2px, matching TaskChip and Badge; py-px keeps it exactly 20px tall, so surrounding layout does not move (Elegant unchanged).
  • 0.5.31 · FixedTaskStatusBadge in Brutal is a square, hard-edged tag again (no radius, 2px black border, bold, 20px tall), matching the Brutal TaskChip and Badge. 0.5.30 rendered it as a rounded pill. Elegant is unchanged.