KpiGrid

A row of headline numbers. Tiles rise in one after another, then each value counts up, its delta turns with its sign and its trend line draws. Data.

Open playground

This month

Revenue12.4%
$0
Active accounts4.1%
0
Churn0.6%
0%
Avg. order1.9%
$0

About

KpiGrid is a React component in the Data category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { KpiGrid } from "@ashutoshswamy/smoui" and set items, columns, title.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { KpiGrid } from "@ashutoshswamy/smoui";

<KpiGrid
  title="This month"
  items={[
    { label: "Revenue", value: 48210, prefix: "$", delta: 12.4, data: [31, 33, 38, 48] },
    { label: "Churn", value: 2.4, suffix: "%", decimals: 1, delta: -0.6 },
  ]}
/>

Props 3

items

One tile each: label, value, prefix, suffix, decimals, delta and data.

StatCardProps[]
columns

Fixed columns. Left out, tiles wrap at 200px minimum.

number
title

Heading above the grid.

string