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

Variants

The variant prop controls the visual style. subtle (the default) renders a lightly filled badge. solid renders a fully filled badge with contrasting text. outline renders a transparent badge with a colored border:

Loading editor
Loading editor
Loading editor

Colors

The Badge accepts palette hues and semantic aliases via the color prop. The default is neutral:

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
Loading editor
Loading editor
Loading editor
Loading editor

Semantic colors

When the color conveys meaning, use the semantic values critical, caution, success, information, accent, feature, and neutral. They map to palette hues but keep the intent readable at the call site:

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

Status indicator

The Badge can show a status indicator dot via the showStatusIndicator prop. Any color may be combined with the indicator. Use it for operational status that describes where something is in its lifecycle:

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

API

PlumaBadge extends Box

Default:'span'

What element or component should be rendered.

Default:true

Whether the badge should render in a bold font weight

Default:neutral

Defaults to neutral (a gray indicator) when omitted.

Default:false

Whether the badge should show a status indicator colored dot

Default:subtle

The visual style of the badge.