Free · MIT licence · No dependencies

Odometer Pricing Free React component

Pricing cards with a monthly / yearly switch. Flip it and every price rolls to its new value digit by digit, like an odometer, with a sliding pill on the switch. Includes a standalone RollingNumber you can use for any counter.

  • React
  • CSS
  • Pricing
  • Numbers
  • Toggle
Odometer Pricing

Get the code

Install in one linenpx shadcn@latest add https://alphenex.com/r/odometer-pricing.json

Works with any React project through the shadcn CLI. Prefer to paste it yourself? Copy the two files below into components/alphenex/. No Tailwind or animation library needed.

import OdometerPricing from '@/components/alphenex/odometer-pricing';

<OdometerPricing />

How the odometer pricing works

Each digit is a small window, exactly one character tall, with overflow hidden. Inside it sits a column of the digits 0 to 9. Showing a 7 means sliding the column up by seven tenths of its height, and a CSS transition turns that jump into the rolling motion.

Digits are keyed from the right, so when 79 becomes 63 the ones column and the tens column each roll on their own, with a short stagger between them. A slight overshoot in the easing makes them settle like a mechanical counter.

The rolling digits are hidden from screen readers. A visually hidden line reads out the real price, such as "$63 per month, billed yearly".

Frequently asked questions

Yes. The file also exports RollingNumber. Give it any whole number as value and it rolls whenever the value changes, for counters, stats or a cart total.

Want motion like this on your website?

We design and build custom websites with motion, 3D and SEO built in. Websites from $500.

More free components

Explore our work