Menus & navigation JS behaviour

Stat strip

A compact stat band; each figure holds at zero until seen, then rolls once in the reader’s digits — a fresh server value rolls again after the morph.

Real scenarios

The component as it is used in a product — not a specimen grid.

The shop’s morning board

Figures are server-rendered in the page’s digits; each holds at zero until it scrolls into view, then rolls up exactly once.

Orders today
128 +12 vs yesterday
Visits
9,412
Avg. basket
764,000
In stock
312

Change them from the server

A Livewire action recomputes the same strip — after the morph, every digit rolls from the old number to the new one.

Orders today
128 +12 vs yesterday
Visits
9,412
Avg. basket
764,000
In stock
312

Important props

Important props
Prop Type Default What it does
stats array [] Each stat: label, value, icon and caption (a text footnote).
label string «آمارها» The description list’s accessible label.

Snippet

<x-nx::stat-strip label="نگاه یک‌روزه" :stats="[
    ['label' => 'سفارش امروز', 'value' => 128, 'icon' => 'layers', 'caption' => '+۱۲ نسبت به دیروز'],
    ['label' => 'بازدید', 'value' => 9412, 'icon' => 'globe'],
    ['label' => 'نرخ تبدیل', 'value' => 3, 'icon' => 'trend-up', 'caption' => '٪'],
]" />