Umbra UI

NumberTicker

Counts to a number with a spring.

Animatedimport { NumberTicker } from 'umbra-ui/motion'

Props

PropTypeDefaultDescription
value requirednumber—Number to count to. Changing it animates from the current value.
duration number2Seconds the count takes.
format NumberFormatOptions—`Intl.NumberFormat` options (currency, percent, fraction digits…).
from number0Number to start from.
locale string—BCP 47 locale for formatting. Defaults to the runtime locale.
reducedMotion "system" | "always" | "never""system"Reduced-motion override. Under reduced motion the final value is shown immediately.
trigger "mount" | "inView"inViewStart on mount, or when scrolled into view.

Usage notes

Formats with Intl.NumberFormat. Changing value animates from the current number.

Accessibility

  • Screen readers only get the final value, never the intermediate numbers.
  • Under reduced motion the final value is shown immediately.

Import

import { NumberTicker } from 'umbra-ui/motion';
import 'umbra-ui/styles.css'; // once, at the root of your app