Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Sliding Number

ProNew

An odometer: each digit rolls in its own column, with locale and currency formatting.

Installation

pnpm dlx shadcn@latest add @viewport/sliding-number

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
value*number

The number to display.

—
formatIntl.NumberFormatOptions

`Intl.NumberFormat` options, e.g. `{ style: "currency", currency: "USD" }`.

—
localestring

BCP 47 locale used for grouping and decimal separators.

"en-US"
classNamestring—

Accessibility

  • Screen readers get the formatted value, not ten stacked digits.
  • Tabular numerals and per-place keys keep the layout steady.
  • Jumps to the value under reduced motion.