// preview in
saved for every page

Badge

A status, count or category in one or two words, next to a title or in a table row. It is text only; for something people click or remove, use a Chip.

Pattern Static textServer componentSource ↗
minimal · light · #3fa34d
Active
variant
tone
dot

Installation

Set up Camaleo once (Installation), then import what you need. It renders on the server.

import { Badge } from "@camaleo/react";

Anatomy

A <span> with the label and, if you ask for it, a small dot before it. Every part has a data-slot you can target from CSS.

Examples

Every example is a real file you can copy. They all wear the skin, mode and brand from the bar above.

minimal · light · #3fa34d
Beta
In reviewNewArchived

Variants

The soft fill is the everyday choice. Save the solid one for the badge that must stand out on the screen, and use the outline when many badges sit together.

DraftIn reviewApprovedExpires in 3 daysRejected

Tones

Pick the tone by meaning: grey for neutral, blue for information, green when it went well, yellow when it needs attention soon, red when something failed.

OnlineOfflineIn a meeting

Status dot

The dot makes a live state, like online or in a meeting, easy to spot in a list. The word next to it is what carries the meaning.

Verified authorEncrypted

With an icon

An icon helps people scan, but the word must say it all. Mark the icon aria-hidden so it isn't read twice.

Count with context

A screen reader that hears "Inbox 3" doesn't know three of what. Add "unread" as hidden text inside the badge.

PaymentsPayments and bank reconciliation squad

Long labels

Labels typed by users can get long. Cap the width and cut the text with an ellipsis; the full name stays in the page for screen readers and in title for the mouse.

Recent orders
OrderCustomerStatus
#4092Ana SilvaDelivered
#4093Rafael SouzaShipped
#4094Juliana CostaLate

In a table

One badge per row, in its own column, lets people compare statuses down the table at a glance.

Counts on filters

Click a filter. The badge only shows the count; the Toggle around it is what people press, and it announces whether it is on.

In context

Badges sit next to what they describe. These are whole pieces of UI you can copy, in the skin you picked.

BM

Beatriz Miranda

Engineering lead

AdminOn call this week
Team member profileCard · Avatar · Badge

Order #4092

Ana Silva

$389.00Delivered
Order statusCard · Badge
Open#148

Date picker shows the wrong month after a time zone change

BugAccessibility
Issue labelsCard · Badge

Guidelines

Payment settled
DoSay the status in plain words.

"Payment settled" is clear to everyone, with or without the color.

Status 200
Don’tInternal codes.

"Status 200" means something to the developer, not to the customer reading it.

New
DoOne or two words.

A short badge reads in a glance and fits on a phone.

This feature was added in yesterday's update
Don’tA sentence in a badge.

Long text gets cut off or breaks the layout. Put explanations in the text, or in an Alert.

Props

PropTypeDefaultDescription
variant"outline" | "soft" | "solid""soft"Visual weight: soft for everyday use, solid to stand out, outline when many badges sit together.
toneTone"neutral"Color by meaning: neutral, information, success, needs attention soon, or failed.
dotbooleanfalseShows a small dot before the label, for live states like "Online".

Badge renders a <span> and takes its attributes, like className, style and title.

Styling hooks

Restyle it without forking: target the attributes, or set the tokens on a parent, a skin or the badge itself.

Attributes

data-variantsoft · solid · outline
data-toneneutral · info · success · warning · danger

Tokens it reads

Color

--cml-accent--cml-accent-fg--cml-border--cml-fg--cml-fg-secondary--cml-surface-raised

Shape & size

--cml-border-width--cml-radius-control-sm--cml-radius-pill

Type & motion

--cml-font-control--cml-font-weight-control--cml-tone-line

This component only

--cml-corner-shape--cml-tone--cml-tone-soft

Accessibility

—A badge is text and never takes focus. To make it clickable, use a Chip or put it inside a button or link.
Was this page helpful? · Edit this page on GitHub