Rolling Number

A number whose digits roll to a new value, as an odometer, for a total or a count that changes.

import { RollingNumber } from "@plexui/react-native"

Examples

Overview

In text

Platforms

iOS 26Android
Native componentNone: the Plex rolling number (SwiftUI's numeric text transition is a modifier of its own)None: the Plex rolling number
LookEach changed digit rolls on its reelEach changed character fades and slides to the new one

API

RollingNumber

PropTypeDefaultDescription
valuenumber—The number shown; a new value rolls each changed digit to it
localesIntl.LocalesArgument"en-US"The locale the number is written in. Its own digits roll, such as Arabic-Indic
formatIntl.NumberFormatOptions—How it is written: a currency, a percent, fraction digits, grouping
size, weight, color, variant…TextProps—The props of Text, for the type and color; the figures are tabular
styleStyleProp<TextStyle>—Style of the characters, such as a font size
containerStyleStyleProp<ViewStyle>—Style of the row of characters
durationnumber600 on iOS, 320 on AndroidHow long a change takes, in ms
animation"roll" | "count""roll"roll turns each changed digit; count counts the whole number to the new value
fromnumbervaluecount: the number it counts up from when it first shows
delaynumber0count: how long it waits before counting, in ms
easing(t: number) => number--rolling-number-ease on iOS, ease-out quint on Androidcount: the curve of the count
onCountEnd() => void—count: called when the count reaches its value (at once with reduced motion)
testIDstring—Test id