Skip to content

Counter Badge

The CounterBadge component is used to highlight and display numerical values or simple count indicators. It is designed to be non-interactive (read-only) and supports different color themes.

Variations

Outline

The outline variant (the default) provides a subtle border-based appearance, ideal for secondary information display.

Secondary

The secondary variant uses a soft background appearance for more prominent display while maintaining subtlety.

Comparison

Compare both variants side by side to see the visual differences:

Themes

The badge supports four color themes. default and info read as neutral indicators for general counts, while success and danger are status indicators that signal an improvement or a concern.

Installation

import { CounterBadge } from '@harnessio/ui/components'
// ...
// Default counter badge
<CounterBadge>1</CounterBadge>
// Info theme counter badge
<CounterBadge theme="info">42</CounterBadge>
// Success theme counter badge
<CounterBadge theme="success">10</CounterBadge>
// Danger theme counter badge
<CounterBadge theme="danger">99+</CounterBadge>