Metric

React KPI metric card with label, value, change delta, trend, an optional sparkline, icon, and action slots. Group tiles with MetricGroup for dashboards.

Metric shows a stat from slots: icon, label, value, change with trend, and an optional MetricChart sparkline. Arrange cards with MetricGroup.

When to use

Use Metric for the headline numbers of a dashboard: requests this month, average processing time, satisfaction score. Show the change against a period so numbers have context. Arrange several with MetricGroup.

For a full series, use Charts instead of a sparkline.

Examples

Label, value, change

With a trend chart

Dashboard grid (MetricGroup)

Full card with icon, action & footer

Props

Props declared by Metric. Native attributes of the underlying element pass through.

<Metric>

PropTypeDefaultDescription
layout"small" | "large"
iconreact.ReactNodeFeatured icon, shown in a 32px brand-tinted circle at the start of the header.
labelreact.ReactNodeShort label beside the icon (e.g. "24h Views").
actionreact.ReactNodeHeader slot at the inline-end (e.g. a "more" menu trigger button).
valuereact.ReactNodeThe metric, pre-formatted by the consumer (e.g. "50%", "SAR 1.2M").
changereact.ReactNodeChange text - include the sign (e.g. "+100%") so AT conveys direction; color comes from trend.
trendTrendTrend: up → success arrow, down → error arrow. Drives the glyph + color.
changeTypeChangeTypeChange glyph style - 01 directional arrow (default) · 02 trend glyph.
changeLabelreact.ReactNodeMuted comparison text beside the change (e.g. "vs last month").
chartreact.ReactNodeTrend chart - pass a <MetricChart> (full-width in large, beside the value in small).
footerreact.ReactNodeFooter actions; when present, a full-bleed divider sits above a space-between actions row.

<MetricChange>

PropTypeDefaultDescription
trendTrend
typeChangeType01 directional arrow (default) · 02 trend glyph.

<MetricChart>

PropTypeDefaultDescription
datarequirednumber[]The series to plot (any numeric scale).
trendTrendLine + area + marker color: up → success, down → error. Default up.
markersnumber[]Indices of data to mark with a dot. Defaults to the highest point.

<MetricGroup>

PropTypeDefaultDescription
orientation"vertical" | "horizontal"
gap"sm" | "md" | "lg"
columnsnumberFixed column count for the horizontal grid (collapses to one column on narrow screens). Omit for an auto-fit responsive grid.

Accessibility

The label and value are text, so they read in order. The trend icon is decorative; the change text must include the direction, such as "+12%", so it is not conveyed by color or icon alone.

The sparkline is hidden from assistive technology and the value carries the meaning. Separators between tiles use role="separator".