Kinetik UI

Odometer

.md

A number whose digits roll like a mechanical counter, forward or back, the long way round.

v1.0.0Live on webreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add odometer

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/odometer.json

Install manually

  1. Install dependencies
    npx expo install react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/odometer.tsx
    View source files

Usage

import { Odometer } from '@/components/kinetik/odometer';

<Odometer value={revenue} decimals={2} prefix="$" locale="en-US" />;

Every digit 0–9 in the formatted value rolls; separators, signs and units stay put. When the value grows the columns roll forward, when it shrinks they roll back, and a column that wraps (9 → 0) keeps rolling instead of reversing through every digit.

When to use

  • Counters and totals that change while the user watches: balances, scores, live metrics.
  • Moments where the size of a change matters as much as the result.

When not to use

  • Values that change many times per second. The digits blur; show a static number or throttle updates.
  • Long tables of numbers. Rolling columns draw the eye; keep them for a few headline figures.

Notes

  • Pass format for full control; the default uses Intl.NumberFormat with decimals fixed so columns stay aligned.
  • Columns are keyed from the right, so gaining a digit (999 → 1,000) slides a new column in on the left.
  • Use a font with tabular figures (the default sets fontVariant: ['tabular-nums']) so digits keep a steady width.

Props

OdometerProps

PropTypeDefaultDescription
valuerequirednumber—
decimalsnumber0Fraction digits shown. Defaults to 0.
localestring—BCP 47 locale for separators. Defaults to the device locale.
prefixstring''Text before the number, e.g. a currency sign.
suffixstring''Text after the number, e.g. a unit.
format(value: number) => string—Full control over formatting. Digits 0–9 in the result roll; everything else is static.
staggernumber24Extra delay per column, right to left, in ms. Defaults to 24.
announcebooleanfalseAnnounce changes to screen readers. Defaults to false.
styleStyleProp<TextStyle>—
containerStyleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
One spring per changed digit column on the UI thread; layout transitions only when the number gains or loses columns.
Measured

Pixel 9 emulator, API 35, release build · interaction median 0.85× the system Settings app on the same emulator (indicative only) · keeps drawing at rest · 164 MB app memory. Frames at rest in the measurement came from the demo changing its value every few seconds; with a fixed value nothing redraws.

Real-device measurement pending.

Accessibility

Reduced motion
Digits change in place without rolling; no column transitions.
Screen readers
Exposed as one text element with the formatted value. Set `announce` to read changes aloud (live region).
Touch target
Not interactive.

Source files

components/kinetik/odometer.tsx is in the Code tab of the preview above.