Skip to content

StatRow

<ax-stat-row> lays out a responsive grid of metrics from a [stats] array, each rendered with ax-statistic. Built from token utilities, so it re-themes with the active preset. Project an optional heading into the default slot above the grid.

import { AxStatRowComponent, type StatItem } from '@axisui-ng/blocks';
stats: StatItem[] = [
{ label: 'Users', value: 12480, trend: 8 },
{ label: 'MRR', value: 42, prefix: '$', suffix: 'k', trend: 12 },
{ label: 'Churn', value: 2.1, suffix: '%', trend: -3 },
{ label: 'NPS', value: 64, trend: 5 },
];
<ax-stat-row [stats]="stats" ariaLabel="Key metrics">
<h2 class="mb-4 text-lg font-semibold">Key metrics</h2>
</ax-stat-row>
InputTypeDefaultNotes
statsStatItem[][]One ax-statistic per item; tracked by label.
columnsnumber0Fixed column count 16. 0 uses responsive auto (grid-cols-2 md:grid-cols-4).
ariaLabelstring''Host aria-label on role="group"; empty omits the attribute.
FieldTypeRequiredNotes
labelstringyesMetric label (also the @for track key).
valuenumber | stringyesForwarded to ax-statistic.
trendnumbernoPercent change; forwarded as trend (omitted → null).
prefixstringnoText before the value (e.g. $).
suffixstringnoText after the value (e.g. k, %).
SlotSelectorNotes
Default<ng-content />Optional projected content (typically a heading) rendered above the stats grid.

Host is role="group". Set ariaLabel so the group has an accessible name. Each cell is a ax-statistic (label + value; trend is not color-only).

Interactive examples live in Storybook under Blocks / StatRow. Run pnpm storybook to explore them.