Metric Box

The Metric Box component displays key metrics in a card-style component, supporting content like icons and subtext.

Usage & Examples

Default

Users Online

1,234
default.tsx
<MetricBox title="Users Online" value="1,234" theme="primary" align="center" size="medium" />

Props API

29 props
Columns
Metric Box props API
Default
Description
alignAlignmentTypeNoprops"center"Text alignment for content. One of: "left" | "center" | "right"
aria-atomicbooleanNoariaWhether assistive tech should present the live region as a whole.
aria-describedbystringNoariaCustom accessible description reference for the whole metric box. Overrides the internal subtext description when provided.
aria-labelstringNoariaCustom accessible label for the whole metric box. Use when the title/value pairing needs a more descriptive spoken label.
aria-labelledbystringNoariaCustom accessible label reference for the whole metric box. Overrides the internal title-based labelling when provided.
aria-live"off" | "polite" | "assertive"NoariaLive region setting for announcing metric value updates. Useful for dynamic dashboards.
classNamestringNostylingOptional additional CSS class names for custom styling.
contentClassNamestringNopropsAdditional class names for the content wrapper.
data-testidstringNotestingBackward-compatible alias for test ID attributes.
decorativeIconbooleanNopropstrueWhether the icon is decorative. Defaults to true.
iconIconComponentNopropsOptional SVG icon to visually represent the metric.
iconAriaLabelstringNopropsAccessible label for the icon when it is not decorative.