Components · Data Display
Badge
A small label — above all the pink unread count and the yellow @ marker, plus soft-tinted and hairline labels.
Also 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).
When to use
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
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, theyousignal: it stays yellow in every theme, Boring Gray included (Themes). It is solid only; a soft or outline Badge has noyoulook.variant="primary"is thebrandcolor, and follows the theme: Boring Gray makes it gray. Don't use it for something addressed to the person, or for a status (usebusy).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, apresence-busysticker. An outline Badge has nobusylook.
States
- A Badge rendered as a button (
render={<button />}) shows the medium tier on hover and press (sticker-mediumon 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).
- One exception: what is new on an Artifact is said in words, in
- 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 anaria-labelthat says what it means: "3 unread", "Mentions you". - Give a Badge rendered as a button an
aria-labelthat names its action ("Open thread replies") when its text doesn't.
Rules
- A
softoroutlinebadge is 20px atradius-stickeron a desktop with a mouse, the same shape as the count badge; on a phone and a touch screen it is 22px atradius-chip, while the count badge stays 20px atradius-sticker. Those values are set under the desktop query, so anh-*orrounded-*passed inclassNamedoesn'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, throughAppLinkCardBadge'sfill(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
Also takes the attributes of its element.
Related
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 inMessageRepliesSummary, a mention of you (MessageReferenceText variant="primary"), and theStepsnumber. - 0.6.0 · Breaking ChangesProps that no longer change anything are removed:
Badgeuppercase;Checkboxsize,variant,color;Statuspulse,attention(status never animates);Switch/SwitchThumbsize;SidebarItemvariant;SidebarItemCount/SidebarItemIndicatorvariantandappearance(the count is always the pink sticker, the indicator the yellow @);NotificationCenterActionButtonvariant;DrawerContentwidth(one-go forms use the wideDialog);AppRailItemIndicatorattention;AppRailItemAttentionchildren;Stepssize,track,renderIndicator,renderTraveler;FilePreviewBadgetype,color. Remove them at call sites. - 0.5.39 · FixedBrutal
TaskStatusBadgedraws a 1px black keyline instead of 2px, matchingTaskChipandBadge;py-pxkeeps it exactly 20px tall, so surrounding layout does not move (Elegant unchanged). - 0.5.31 · Fixed
TaskStatusBadgein Brutal is a square, hard-edged tag again (no radius, 2px black border, bold, 20px tall), matching the BrutalTaskChipandBadge. 0.5.30 rendered it as a rounded pill. Elegant is unchanged.