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-upprops
| name | type | default | description |
|---|---|---|---|
| value * | number | - | target number to animate toward. |
| duration | number | 1 | tween length in seconds. |
| decimals | number | 0 | fixed decimal places; ignored when format is set. |
| format | (n: number) => string | - | custom formatter; overrides decimals. |
| prefix | string | - | text rendered before the number. |
| suffix | string | - | text rendered after the number. |
| as | ElementType | 'span' | |
| className | string | - |