3.0.1 • Published 5 years ago

react-countup-v2 v3.0.1

Weekly downloads
85
License
MIT
Repository
github
Last release
5 years ago

react-countup-v2

React component wrap for CountUp.js

Installation

$ npm install --save countup.js react-countup-v2

Usage

import ReactCountUp from 'react-countup-v2';

export default () => {
  const onReady = (instance, CountUp) => {};
  const onComplete = (instance, CountUp) => {};
  const onUpdate = (instance, CountUp) => {};
  const onError = error => console.error(error);

  return (
    <ReactCountUp
      delay={10}
      endVal={1000}
      onReady={onReady}
      onComplete={onComplete}
      onUpdate={onUpdate}
      onError={onError}
    />
  );
}

propTypes

className: PropTypes.string,
delay: PropTypes.number,
endVal: PropTypes.number,
options: PropTypes.object,
onReady: PropTypes.func,
onComplete: PropTypes.func,
onUpdate: PropTypes.func,
onError: PropTypes.func,

Read more

defaultProps

className: null,
endVal: 100,
delay: 0,
options: {
  startVal: 0,
  decimalPlaces: 0,
  duration: 2,
  useEasing: true,
  useGrouping: true,
  smartEasingThreshold: 999,
  smartEasingAmount: 333,
  separator: ',',
  decimal: '.',
  easingFn: null,
  formattingFn: null,
  prefix: '',
  suffix: '',
  numerals: [],
},
onReady: () => {},
onComplete: () => {},
onUpdate: () => {},
onError: () => {},

License

MIT

3.0.1

5 years ago

3.0.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago