Badges are read-only indicators used to communicate a category, metadata, a numeric quantity, or a process's current state.

Importing

The component can be imported via:

import { Badge } from '@customerio/pluma-components/react';

Usage

Loading editor

Colors

The Badge component accepts a range of colors via the color prop, the default being neutral. The neutral, accent, neutral-outline, and accent-outline colors render as a fully-rounded pill — use them for numeric quantities such as counts. The redgrey colors render in a squarer shape — use them to communicate a category, metadata, or status:

Loading editor
Loading editor
Loading editor
Loading editor
Loading editor
Loading editor
Loading editor
Loading editor
Loading editor
Loading editor
Loading editor
Loading editor
Loading editor
Loading editor

Semantic colors

When the color conveys meaning, use the semantic values critical, caution, success, and information — they render identically to red, yellow, green, and blue, but keep the intent readable at the call site. Use the raw colors for purely decorative categorization:

Loading editor
Loading editor
Loading editor
Loading editor

Status indicator

For the semantic colors and the red, yellow, green, blue, purple, and grey colors, the Badge can show a status indicator dot via the showStatusIndicator prop. Use it for operational status that describes where something is in its lifecycle. Prefer a semantic color with the indicator when the status dot implies the color carries meaning that aligns with the semantics:

Loading editor

Bold

Badge text renders in a bold font weight by default. Set bold={false} for a less visually prominent badge. Light text is not compatible with status indicators:

Loading editor

Deprecated variations

Loading editor
Loading editor
Loading editor

API

Badge extends Box

Default:true

Whether the badge should render in a bold font weight

Default:neutral

The visual style of the badge. The redgrey colors render in the squarer shape of the (deprecated) Label component; neutral, accent and the outline colors render as a fully-rounded pill. The semantic values critical, caution, success, and information render identically to red, yellow, green, and blue — use them when the color conveys meaning. Note: When using status indicators, only the semantic values and the red, yellow, green, blue, purple, and grey colors are supported.

Deprecated:

Use color="accent" instead (or color="accent-outline" when combined with isOutline)

Whether the badge should render in "emphasis" variant

Deprecated:

Use color="neutral-outline" instead (or color="accent-outline" when combined with isEmphasized)

Whether the badge should render in the "outlined" variant

Default:false

Whether the badge should show a status indicator colored dot