Skip to content
Effects

Odometer

Digits that roll like a mechanical counter.

import
import { Odometer } from '@joshicodes/cock';

Rolling

People who giggled at the package name

1,284

Behaviour

  • Digits are keyed from the right, so the ones column stays put as the number grows.

API

Read out of the component sources at build time, so it matches the version you installed. Every component also takes class, merged through tailwind-merge so your utility wins.

Props of Odometer

PropTypeDefault
value required
number—
locale
string—
options

Passed to Intl.NumberFormat, e.g. `{ style: 'percent' }`.

Intl.NumberFormatOptions—
duration

Milliseconds per roll.

number700
class
string—

See also

cock. Yes, it stands for core component kit. We checked twice.