Knit UI
GitHub

Playground

Loading playground…

true
false
false
Playground
<RollingNumber
  value={1234}
  fontSize="xxl"
  animationDuration={600}
  tabularNumbers
  withLiveRegion={false}
/>

Examples

Font Sizes

Full font-size token scale shown side by side to illustrate the sizing knob.

Loading example…

Font SizesSourceStorybook

Custom Font Size

Numeric custom font size remains available for exact animation geometry.

Loading example…

Custom Font SizeSourceStorybook

With Prefix And Suffix

Prefix and suffix characters rendered statically around the rolling digits.

Loading example…

With Prefix And SuffixSourceStorybook

Formatted Number

Thousands separator groups digits for large numbers; decimal scale fixes the fractional part.

Loading example…

Formatted NumberSourceStorybook

Negative Value

Negative value — the minus sign renders as a static character slot.

Loading example…

Negative ValueSourceStorybook

Animated Counter

A controlled counter that increments and decrements so you can watch the roll animation.

Loading example…

Animated CounterSourceStorybook

Live Region

Live region mode announces every value change to screen readers.

Loading example…

Live RegionSourceStorybook

No Animation

Animation disabled (duration=0) — digits snap immediately without rolling.

Loading example…

No AnimationSourceStorybook

Styles

Per-slot styles targets individual parts — here the digitViewport and digitText.

Loading example…

StylesSourceStorybook

Props

PropTypeDefaultDescription
value requirednumber1234The number value to display.
animationDurationnumber | undefined600Roll animation duration in ms (0 disables animation).
decimalScalenumber | undefinedNumber of decimal places to display.
decimalSeparatorstring | undefined"."Decimal separator character.
disabled systemboolean | undefined
fixedDecimalScaleboolean | undefinedfalsePad trailing zeros to match `decimalScale`.
fontSizenumber | RollingNumberFontSize | undefined
xxs · xs · sm · md · lg · xl · xxl
"xxl"Digit font size. Standard values resolve against the fontSize scale; numbers are custom px sizes.
prefixstring | undefinedPrefix rendered before the value.
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
styles systemSlotStyles<RollingNumberStyles> | undefinedPer-slot style sugar — props spread onto the matching digit-column parts.
suffixstring | undefinedSuffix rendered after the value.
tabularNumbersboolean | undefinedtrueUse monospace digits so columns stay aligned.
theme systemThemeName | null | undefinedApplies a theme to this element
thousandSeparatorstring | boolean | undefinedfalseThousands separator; `true` uses `,`.
withLiveRegionboolean | undefinedfalseAnnounces changes to screen readers via an aria-live region.

Style slots

Every part of RollingNumber can be styled through the styles prop. Explicit props on the component always win over slot styles.

SlotUsage
digitStripstyles={{ digitStrip: { … } }}
digitTextstyles={{ digitText: { … } }}
digitViewportstyles={{ digitViewport: { … } }}
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<TamaguiElement> | undefined

Plus 498 inherited style props from Box — the full Tamagui/React Native style surface, including token shorthands like p, mx, bg and c. See Tokens for the scales they accept, or the full list.