component · data

TuxStatComparison

One headline metric with a comparison reading. Pairs with TuxBigStat (value + label, no comparison) and TuxFactoid (row of stats, no comparison logic). Use this when the comparison reading is the point — "we moved by X." Direction-aware: up + good = success (green); down + good (latency, error rate) = success too via polarity="invert".

flagship · direct polarity

Indexed corpus growth

indexed corpus

47.2 TB+1.4 TB (+3.1%)

vs last week

<tux-stat-comparison
  eyebrow="indexed corpus"
  :current="47.2"
  :previous="45.8"
  suffix=" TB"
  label="vs last week"
/>

inverted polarity

Latency improvement

For metrics where going down is good (response time, error rate, cost), pass polarity="invert". The delta direction reads the same, but the tone flips to success for a downward move.

median response time

180 ms-60 ms (-25.0%)

vs last release

<!-- Inverted polarity: down is good -->
<tux-stat-comparison
  eyebrow="median response time"
  :current="180"
  :previous="240"
  suffix=" ms"
  label="vs last release"
  polarity="invert"
/>

stack layout

For narrow tiles

active sessions

8+2 (+33.3%)

vs yesterday

<tux-stat-comparison
  eyebrow="active sessions"
  :current="8"
  :previous="6"
  :decimals="0"
  label="vs yesterday"
  layout="stacked"
/>

inline · KPI rows

Compact format

Use layout="inline" when a row of comparisons sits in a tight KPI strip. Smaller value, smaller delta pill, single-line layout.

412+23 (+5.9%)

files tracked

14-8 (-36.4%)

errors / hr

100%0% (0.0%)

uptime · 30d

<!-- Inline layout — for KPI rows next to other stats -->
<tux-stat-comparison
  :current="412"
  :previous="389"
  :decimals="0"
  label="files tracked"
  layout="inline"
/>