Stats Grid
ProDashboard section of separate metric cards with count-up values in a grid that goes from one to four columns. The baseline card per metric row.
How it differs. One card per metric in an even grid: every figure has equal weight, with no chart, no comparison between cards and no interaction.
Install
pnpm dlx shadcn@latest add @hazine/stats-gridAdds 1 file and 2 Hazine items (@hazine/heading, @hazine/metric-card).
First time? Add the registry to components.json
{
"registries": {
"@hazine": {
"url": "https://api.hazine.dev/r/{name}.json",
"headers": { "Authorization": "Bearer ${HAZINE_TOKEN}" }
}
}
}Set HAZINE_TOKEN in your environment. The token comes with a Pro licence.
The source of a Pro item is not published on this site. It installs into your codebase with the same command once your registry entry carries a Pro token.
- components/blocks/stats-grid.tsx
- 86 lines
- 1 file
- 86 lines
pnpm dlx shadcn@latest add @hazine/stats-gridAdds 1 file and 2 Hazine items (@hazine/heading, @hazine/metric-card).
Props6
- title
- string = "This month at a glance"
- description
- string = "Figures update as payments are reconciled."
- metrics
- StatsGridMetric[] = DEFAULT_METRICS
- period
- string = "vs last 30 days"
- Baseline every delta is measured against.
- locale
- string = "en-US"
- headingLevel
- HeadingLevel = 2
Also accepts every prop of Omit<React.ComponentProps<"section">, "title">.
Accessibility
- Pattern
- Landmarks and headings
- Keyboard
- Nothing to operate. The item has no focusable parts.
- Screen reader
A section labelled by its heading that holds a list of metric groups, each labelled by the metric name.
- Reduced motion
- Values are shown at once and nothing counts.
- Checked
- Not checked yet. Automated results appear here once CI has run.
Dependencies2
- @hazine/heading
- @hazine/metric-card
Filled chips are registry items the CLI adds for you. Outlined chips are npm packages.
Tokens shipped0
None. The item is styled by the tokens your theme already has.