Metric Box

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

Usage

Default

Users Online

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

Props

Sortable data table
PropTypeDefaultDescription
titlestring-Title of the metric or label displayed at the top.
valuestring | number-Main value or statistic to display prominently.
iconReact.ElementType-Optional icon to display at the top of the metric box.
subtextstring-Small helper or context text shown below the value.
theme"primary" | "secondary" | "tertiary" | "quaternary" | "clear"Configured DefaultTheme color variant.
state"success" | "error" | "warning"-State color for additional meaning.
align"left" | "center" | "right""center"Text alignment of the metric box content.
size"xs" | "small" | "medium" | "large" | "xl"Configured DefaultSize of the metric box.
outlinebooleanfalseIf true, renders an outlined variant.
rounding"none" | "small" | "medium" | "large"Configured DefaultBorder radius for the card.
shadow"none" | "light" | "medium" | "strong" | "intense"Configured DefaultShadow depth for the card.
classNamestring-Custom CSS class for the metric box.
data-testidstring"metric-box"Test id for querying the component in tests.