Rolling Digits

+
About this component

Rolling Digits

A number whose digits roll like an odometer, each column sliding to its new figure a beat after the last, whenever the value changes. For prices that switch with a toggle, years, and live counters that climb on their own.

Usage

The import and the props worth knowing about, in one place.

import { Text17 } from "@/components/beste/component/text17";
import { useState } from "react";

const [season, setSeason] = useState(false);

<Text17 value={season ? 62 : 70} prefix="$" className="font-serif text-6xl" />

<Text17 value={2026} grouping={false} duration={1} />

// Or let it climb on its own: one every second, for a live counter
<Text17 value={1240} suffix="+" tick={1} />

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
value*number—The number to show; change it and the digits roll to the new value
prefixstring—
suffixstring—
groupingboolean—Group thousands with separators
durationnumber—Seconds a digit takes to roll
ticknumber—Advance by one every `tick` seconds, for live counters and clocks. Leave unset for a controlled value.
classNamestring—

More Text components

View all Text

0+

A
A clear glass perfume bottle and two small jars casting amber shadows on warm paper
Ember No. 9 · Eau de parfum · 50 ml · Bitter orange · Fig leaf · Smoked amber · Vetiver · Composed in Grasse · Poured by hand ·