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

30 props
Columns
Metric Box props API
Default
Description
align"left" | "right" | "center"Noprops"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.
glassbooleanNopropsconfigured default glass setting (fallback: false)Applies a translucent frosted-glass treatment using the active theme palette.
iconIconTypeNopropsOptional icon to visually represent the metric (from react-icons, for example).