Skip to content
Storybook

Stat

KPI tile: label, value and a trend badge against a comparison period.

Preview

React · live from the Storybook
Stat preview

HTML and CSS

The same component as plain HTML with pixels-ui.css, no framework needed.

Total revenue
$45,23120%vs last month
Churn
2.4%0.6%

Usage

  • Trend color is paired with an arrow, never color alone.

Installation

Included in the core files. No extra install.

HTML
<link rel="stylesheet" href="/css/pixels-tokens.css">
<link rel="stylesheet" href="/css/pixels-ui.css">
<script src="/js/pixels-ui.js" defer></script>

API reference

Class / attributeTypeDescription
px-statclassTile.
px-trend · --down · --neutralclassTrend.

Figma properties

Stat6 variants · page “Data display”Open

KPI tile: label, value and trend badge against a comparison period. Trend colour is paired with an arrow so it does not rely on colour alone. Numbers use Arabic-Indic digits in the Arabic locale.

PropertyTypeValues
LabelText“Total revenue”
ValueText“$45,231.89”
Show trendBoolean—
TrendVariantUp Down Neutral
DirectionVariantLTR RTL

Design tokens

Component tokens from the Figma Component collection. Override them to restyle just this component.

TokenAliasLight value
--px-stat-labelcolor-content-neutral-secondary#475467

Accessibility

  • Say the direction in text for screen readers if the arrow is the only cue.