CountUp

Animates a number up to a target value when the element enters the viewport.

2500000984200

Usage

import { CountUp } from '@bwo-ui/react';

<CountUp to={2_500_000} duration={2} />
<CountUp to={98} suffix="%" duration={1.6} />
<CountUp to={4200} prefix="$" separator="," />

Props

PropTypeDefaultDescription
tonumberEnd value.
fromnumber0Start value.
durationnumber2Seconds.
decimalsnumber0Decimal places.
separatorstring','Thousands separator.
decimalstring'.'Decimal separator.
prefixstringPrepended (e.g. "$").
suffixstringAppended (e.g. "%").
startstring'top 85%'ScrollTrigger start.
oncebooleantruePlay only once.