Badges are read-only indicators used to communicate a category, metadata, a numeric quantity, or a process's current state.
The component can be imported via:
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 red–grey colors render in a squarer shape — use them to communicate a category, metadata, or status:
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:
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:
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:
Default:true
Whether the badge should render in a bold font weight
Default:neutral
The visual style of the badge.
The red–grey 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.
Use color="accent" instead (or color="accent-outline" when combined with isOutline)
Whether the badge should render in "emphasis" variant
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