Stat Card

Sparkline

A KPI tile with value, change and trend.

Monthly revenue
$48,210
Up12.5%vs last month
Active users
12.9K
Up3.2%vs last month
Churn rate
2.4%
Up0.3%vs last month

Installation

pnpm add krz-ui

Usage

import { StatCard } from "krz-ui";
<StatCard
  label="Monthly revenue"
  value="$48,210"
  delta={{ value: 12.5, label: "vs last month" }}
  trend={[31, 34, 33, 38, 41, 44, 48]}
/>

API Reference

PropTypeDescription
labelReactNodeWhat the number is, in sentence case.
valueReactNodeThe headline figure, already formatted.
delta{ value, label?, format?, upIsGood? }Change vs a named period. Set upIsGood: false for costs, churn or latency.
trendnumber[]Recent values for a sparkline.
iconReactNodeOptional icon in the top-right corner.
className / style / ref—All go to the outer element. See Customization.
classNames{ label?, icon?, value?, delta?, period?, trend? }Extra classes for inner parts.