Stat Strip
A row of headline numbers: cards on desktop, stacked rows on a phone.
Revenue
$48,200
+12% vs last monthOrders
1,284
38 awaiting shipmentRefunds
$640
1.3% of revenueimport { StatStrip } from "@dapplelight/signet-ui/components/stat-strip"
export function Demo() {
return (
<StatStrip
isDesktop
items={[
{ label: "Revenue", value: "$48,200", meta: "+12% vs last month", tone: "good" },
{ label: "Orders", value: "1,284", meta: "38 awaiting shipment", tone: "warn" },
{ label: "Refunds", value: "$640", meta: "1.3% of revenue" },
]}
/>
)
}Installation
npm i @dapplelight/signet-uiUsage
import { StatStrip } from "@dapplelight/signet-ui/components/stat-strip"
<StatStrip items={[{ label: "Orders", value: "1,284" }]} />Examples
Phone layout
- Revenue+12% vs last month
- $48,200
- Orders38 awaiting shipment
- 1,284
- Refunds
- $640
import { StatStrip } from "@dapplelight/signet-ui/components/stat-strip"
export function Demo() {
return (
<StatStrip
isDesktop={false}
className="max-w-sm"
items={[
{ label: "Revenue", value: "$48,200", meta: "+12% vs last month", tone: "good" },
{ label: "Orders", value: "1,284", meta: "38 awaiting shipment", tone: "warn" },
{ label: "Refunds", value: "$640" },
]}
/>
)
}Four stats
Active users
9,310
Trials
212
+18 this weekChurn
2.1%
above targetMRR
$31,900
import { StatStrip } from "@dapplelight/signet-ui/components/stat-strip"
export function Demo() {
return (
<StatStrip
isDesktop
items={[
{ label: "Active users", value: "9,310" },
{ label: "Trials", value: "212", meta: "+18 this week", tone: "good" },
{ label: "Churn", value: "2.1%", meta: "above target", tone: "warn" },
{ label: "MRR", value: "$31,900" },
]}
/>
)
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
items | StatItem[] | - | The stats. Labels must be unique (they are the keys). |
isDesktop | boolean | follows the md breakpoint | Force the grid (true) or the stacked rows (false). |
className | string | - | Merged onto the wrapper. |
StatItem
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | - | Caption. |
value | ReactNode | - | The headline number. |
meta | ReactNode | - | A line under it. |
tone | "good" | "warn" | "muted" | "muted" | Colours the meta line. Never red, which means destructive. |
Under the privacy mask, percentages in string values and meta lines show as masked dots.