MetricsNumbers
A 96px minimum-height metric strip on surface/default. Each equal-width section has a 16px icon with a 13/18 label above a 24/28 semibold value. Callers own every icon, label, value and optional palette color. A value can contain more than text, including the small blue chevron shown here. The shared Separator atom divides sections; standard metrics wrap two per row on narrow screens. The explicit mobile mode shows two values in a bordered card, up to two actions below them, and up to two more values in a summary outside it.
Playground
Live preview
Playground
Live preview
States and variants
Value without an icon, with an explanation
Reserved funds with a trailing chevron
Three metrics with different duotone icon colors
Four metrics with equal columns and dividers
Four metrics in two mobile rows
Five metrics wrapping on narrow screens
Custom value content and palette color
Empty state supplied by the caller
No metrics yet.
Mobile
Pass mobile for the compact composition. The first metric is wider and larger; the third and fourth appear below the card. The caller supplies the summary lead-in and zero, one or two footer actions.
Examples
Four values and two equal footer actions
Three values and one full-width action
Two values without footer actions or summary
One value with a caller-owned action
Code
import { LockBoldDuotoneIcon, MetricNextIcon, MetricsNumbers } from "@npolyhunter/ui";
<MetricsNumbers
metrics={[
{
id: "reserved",
icon: <LockBoldDuotoneIcon
color="var(--color-status-info-foreground)"
secondaryColor="var(--color-status-info-foreground)"
/>,
label: "Reserved for missions",
value: <><span>$40.00</span><MetricNextIcon className="size-3.5 text-status-info-foreground" /></>,
},
{ id: "paid", icon: <WalletBoldDuotoneIcon />, label: "Total paid",
value: "$1,240.00", valueColor: "var(--color-reward-accent)" },
]}
emptyState={null}
mobile={false}
mobileFooterActions={undefined}
mobileSummaryLabel={undefined}
className={undefined}
/>;import { Button, LockBoldDuotoneIcon, MetricsNumbers, TransferHorizontalBoldDuotoneIcon } from "@npolyhunter/ui";
<MetricsNumbers
mobile
metrics={[
{ id: "balance", icon: <TransferHorizontalBoldDuotoneIcon />,
label: "Available balance", value: "$120.00" },
{ id: "reserved", icon: <LockBoldDuotoneIcon />,
label: "Reserved", value: "$40.00", valueColor: "var(--color-status-info-foreground)" },
{ id: "earned", icon: null, label: "Earned", value: "$25.00" },
{ id: "spent", icon: null, label: "Spent", value: "$35.00",
valueColor: "var(--color-reward-accent)" },
]}
mobileSummaryLabel="This month"
mobileFooterActions={[
<Button key="add" variant="primary">Add funds</Button>,
<Button key="withdraw" variant="outline">Withdraw</Button>,
]}
emptyState={null}
className={undefined}
/>;Used in
Includes use through shared UI components.
