1.1.3 • Published 6 years ago

react-count-animation v1.1.3

Weekly downloads
221
License
MIT
Repository
github
Last release
6 years ago

react-count-animation

npm MIT License

Using TWEEN algorithm, digital animation based on react.

Display

display

Install

npm install react-count-animation@latest

How to use

import stylesheet:

import 'react-count-animation/dist/count.min.css';
import React from 'react';
import ReactDOM from 'react-dom';
import AnimationCount from 'react-count-animation';

const Count = () => {
  const settings = {
    start: 99923,
    count: 9999999,
    duration: 3000,
    decimals: 4,
    useGroup: true,
    animation: 'up',
  };
  const settings2 = {
    start: 1,
    count: 9999999,
    duration: 1000,
    decimals: 2,
    useGroup: true,
    animation: 'roll',
  };
  const settings3 = {
    start: 1,
    count: 9999999,
    duration: 3000,
    decimals: 2,
    useGroup: true,
    animation: 'slide',
  };
  return (
    <div>
      <h1 className="title">Count Animation</h1>
      <div className="exam-div">
        <AnimationCount {...settings}/>
      </div>
      <h1 className="title">Count Roll</h1>
      <div className="exam-div">
        <AnimationCount {...settings2}/>
      </div>
      <h1 className="title">Count Slide</h1>
      <div className="exam-div">
        <AnimationCount {...settings3} />
      </div>
    </div>
  );
}

export default Count;

Options

PropertyTypeDescription
startNumberInitial value
countNumbertarget value
durationNumberAnimation time length, in milliseconds
decimalsNumberdecimals
useGroupboolWhether to use ',' the number of segments
animationstringAnimation effects: 'up' => 'CountUp';'roll' => 'CountRoll''slide' => 'CountSlide'

License

MIT

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago