Stat

Stats summarize key product metrics with restrained hierarchy and optional trend context.

Overview and decision boundary

Use Stat to summarize a single metric with optional trend context.

Do not overload one Stat with multiple metrics.

Preview

Active projects12+3 this week
Open tasks348 due today
import { Stat } from '@nerio-ui/ui';<Stat label="Active projects" value="12" trend="+3 this week" />

Installation and imports

Install the editable registry source, or use the matching package entrypoint when the product keeps Nerio as a workspace dependency.

pnpm dlx nerio add statimport { Stat } from '@nerio-ui/ui';

Usage

import { Stat } from '@nerio-ui/ui';<Stat label="Active projects" value="12" trend="+3 this week" />

Variants

VariantPurpose
DefaultNeutral metric summary.

Anatomy

SlotPurpose
cardCard-composed metric root with the n-stat customization hook.
labelNames the metric.
valuePrimary numeric or short text value.
trendOptional supporting comparison.

States

StatePurpose
StaticDisplays a point-in-time value.

Motion

  • State changes should use shared motion tokens and preserve reduced-motion behavior.

Accessibility

  • Use clear labels so values remain understandable out of context.
  • Keep trend text textual; do not encode direction by color alone.
  • Use advanced KPI cards outside the core primitive layer.

API

PropPurpose
classNameExtends the component root while preserving Nerio tokenized defaults.

Implementation contract

ContractValue
Registry itemstat installs 5 source files into the configured components directory.
Base UINo interactive primitive required.
Registry dependenciescard
Package dependenciesclsx, react, tailwind-merge, tailwindcss

Styling contract

ContractValue
AuthoringComplete, statically detectable Tailwind CSS v4 recipes own component visuals.
ValuesSemantic and component --n-* variables remain the canonical customization layer.
OverridesCustomizable slots merge consumer className values with tailwindCn so conflicting utilities resolve deterministically.
Residual CSSOnly shared keyframes and scoped no-Preflight compatibility rules remain; there is no parallel visual selector layer.

Design notes

  • Use Stat to summarize a single metric with optional trend context.

Do / do not

Do

Use for one simple metric with a clear label.

Do not

Do not overload one Stat with multiple metrics.

Do not turn Stat into KPI Card; advanced dashboard cards belong to Pro.

Tokens

These are the primary customization points. Override semantic or component tokens instead of changing component source.

TokenPurpose
--n-stat-gapPublic customization point for this component contract.
--n-stat-value-sizePublic customization point for this component contract.
--n-stat-trend-colorPublic customization point for this component contract.