Stats

A few numbers that stand for a product, each over what it counts, in a ruled row or on cards, here centred.

Stat 1
10,000
Stat 2
7
Stat 3
99.9%
import { Stats, type StatItem } from "@produkto/ui/Stats";

const items: StatItem[] = [
  { value: "10,000", label: "Stat 1" },
  { value: "7", label: "Stat 2" },
  { value: "99.9%", label: "Stat 3" },
];

const Example = () => <Stats align="center" items={items} />;

export default Example;

Usage

import { Stats, type StatItem } from "@produkto/ui/Stats";
const items: StatItem[] = [
  { value: "100+", label: "Stat 1" },
  { value: "99.9%", label: "Stat 2" },
  { value: "24/7", label: "Stat 3" },
];

<Stats items={items} />

Examples

Cards

layout="cards" sets each number on a card, with its description under its label.

Stat 1
100+
A short line about this number goes here.
Stat 2
99.9%
A short line about this number goes here.
Stat 3
24/7
A short line about this number goes here.
import { Stats, type StatItem } from "@produkto/ui/Stats";

const items: StatItem[] = [
  {
    value: "100+",
    label: "Stat 1",
    description: "A short line about this number goes here.",
  },
  {
    value: "99.9%",
    label: "Stat 2",
    description: "A short line about this number goes here.",
  },
  {
    value: "24/7",
    label: "Stat 3",
    description: "A short line about this number goes here.",
  },
];

const Example = () => <Stats items={items} layout="cards" />;

export default Example;

Beside words

layout="split" sets the heading and its button beside the numbers, two to a row, each after a thin rule.

Eyebrow

Your headline goes here

A short line about it goes here.

Stat 1
640
Stat 2
28
Stat 3
31
Stat 4
98%
import { Stats, type StatItem } from "@produkto/ui/Stats";
import type { BlockAction } from "@produkto/ui/Section";

const items: StatItem[] = [
  { value: "640", label: "Stat 1" },
  { value: "28", label: "Stat 2" },
  { value: "31", label: "Stat 3" },
  { value: "98%", label: "Stat 4" },
];

const actions: BlockAction[] = [
  { label: "Primary action", link: "#", appearance: "outline" },
];

const Example = () => (
  <Stats
    actions={actions}
    description="A short line about it goes here."
    eyebrow="Eyebrow"
    items={items}
    layout="split"
    title="Your headline goes here"
  />
);

export default Example;

Centred on a band

theme="dark" with align="center" sets a few large numbers centred on the deep band.

Eyebrow

Your headline goes here

A short line about it goes here.

Stat 1
300
Stat 2
12
Stat 3
0
import { Stats, type StatItem } from "@produkto/ui/Stats";

const items: StatItem[] = [
  { value: "300", label: "Stat 1" },
  { value: "12", label: "Stat 2" },
  { value: "0", label: "Stat 3" },
];

const Example = () => (
  <Stats
    align="center"
    description="A short line about it goes here."
    eyebrow="Eyebrow"
    items={items}
    theme="dark"
    title="Your headline goes here"
  />
);

export default Example;

With a title and description

title and description head the band, and the numbers sit under them.

Your headline goes here

A short line about what the product does goes here.

Stat 1
100+
Stat 2
99.9%
Stat 3
24/7
Stat 4
$19
import { Stats, type StatItem } from "@produkto/ui/Stats";

const items: StatItem[] = [
  { value: "100+", label: "Stat 1" },
  { value: "99.9%", label: "Stat 2" },
  { value: "24/7", label: "Stat 3" },
  { value: "$19", label: "Stat 4" },
];

const Example = () => (
  <Stats
    description="A short line about what the product does goes here."
    items={items}
    title="Your headline goes here"
  />
);

export default Example;

Centred

align="center" centres each number over its label, and drops the rules between them.

Stat 1
100+
Stat 2
99.9%
Stat 3
24/7
import { Stats, type StatItem } from "@produkto/ui/Stats";

const items: StatItem[] = [
  { value: "100+", label: "Stat 1" },
  { value: "99.9%", label: "Stat 2" },
  { value: "24/7", label: "Stat 3" },
];

const Example = () => <Stats align="center" items={items} />;

export default Example;

API Reference

Stats

StatsProps · blocks/Stats/Stats.types.ts
PropTypeDefault
itemsStatItem[]-
layoutStatsLayout"row" | "cards" | "split""row"
actionsBlockAction[]-
idstring-
eyebrowstring-
titleReactNode-
descriptionReactNode-
alignSectionAlign"start" | "center" | "end""start"
mutedbooleanfalse
themeThemeMode"light" | "dark"-
classNamestring-

StatItem

used by items
PropTypeDefault
valuerequiredstring-
labelrequiredstring-
descriptionstring-

BlockAction

used by actions
PropTypeDefault
appearanceButtonAppearance"solid" | "soft" | "outline" | "transparent"-
toneButtonTone"neutral" | "accent" | "destructive" | "success" | "warning" | "info"-
iconReactNode-
iconOnlyboolean-
borderRadiusBlockActionBorderRadius"none" | "xs" | "sm" | "base" | "lg" | "xl" | "full"-
labelrequiredstring-
linkrequiredstring-