components / count-up

count-up.

animated number that tweens to its target with an easeout curve, starting when scrolled into view. dependency-free requestanimationframe, respects prefers-reduced-motion.

0
0.0%
installation
bunx @justin06lee/chrome@latest add count-up
props
nametypedefaultdescription
value *number-target number to animate toward.
durationnumber1tween length in seconds.
decimalsnumber0fixed decimal places; ignored when format is set.
format(n: number) => string-custom formatter; overrides decimals.
prefixstring-text rendered before the number.
suffixstring-text rendered after the number.
asElementType'span'
classNamestring-