Statistic

Display numeric values with labels, prefixes, and formatting.

When to Use

  • For dashboard KPIs and metrics
  • To highlight important numbers
  • For countdown timers

Import

import { Statistic } from "orizon";

Examples

Basic

Active Users
112,893
Revenue
112,893.00
<Statistic title="Active Users" value={112893} />
<Statistic title="Revenue" value={112893} precision={2} />

With Prefix/Suffix

Growth
11.28%
Decline
9.30%
import { ArrowUp } from "lucide-react";

<Statistic
  title="Growth"
  value={11.28}
  precision={2}
  prefix={<ArrowUp />}
  suffix="%"
  valueStyle={{ color: "#0d9488" }}
/>

Countdown

<Statistic.Countdown
  title="Event Starts"
  value={Date.now() + 1000 * 60 * 60 * 24}
  onFinish={() => console.log("Done!")}
/>

API

StatisticProps

  • titleReactNode — Statistic label
  • valuestring | number — Numeric value
  • precisionnumber — Decimal precision
  • prefixReactNode — Element before value
  • suffixReactNode — Element after value
  • valueStyleCSSProperties — Value text styles
  • formatter(value) => ReactNode — Custom format function
  • groupSeparatorstring — Thousands separator (default: ",")
  • decimalSeparatorstring — Decimal separator (default: ".")
  • loadingboolean — Show skeleton

Statistic.Countdown Props

  • valuenumber — Target timestamp (ms)
  • formatstring — Display format (default: "HH:mm:ss")
  • onFinish() => void — Callback when countdown reaches zero
  • onChange(value: number) => void — Callback on each tick