React Component to animate a changing value
  • JavaScript 39.8%
  • TypeScript 31.2%
  • HTML 19.1%
  • CSS 9.9%
Find a file
2020-04-30 15:41:49 -05:00
example Added in keywords 2020-04-30 15:41:49 -05:00
src Minor cleanup of repo 2020-04-30 11:25:35 -05:00
.editorconfig Initial setup 2020-04-24 10:33:34 -05:00
.eslintignore init create-react-library@3.0.8 2020-04-23 19:51:52 -05:00
.eslintrc init create-react-library@3.0.8 2020-04-23 19:51:52 -05:00
.gitignore Minor cleanup of repo 2020-04-30 11:25:35 -05:00
.prettierrc Initial setup 2020-04-24 10:33:34 -05:00
.travis.yml init create-react-library@3.0.8 2020-04-23 19:51:52 -05:00
package-lock.json Added in keywords 2020-04-30 15:41:49 -05:00
package.json Added in keywords 2020-04-30 15:41:49 -05:00
README.md Updated readme 2020-04-30 15:06:24 -05:00
tsconfig.json Minor cleanup of repo 2020-04-30 11:25:35 -05:00
tsconfig.test.json init create-react-library@3.0.8 2020-04-23 19:51:52 -05:00

@jhonnold/react-animated-number

React Component to animate a number changing value

NPM downloads build status license

Install

npm install --save @jhonnold/react-animated-number

Getting Started

import AnimatedNumber from '@jhonnold/react-animated-number';

<AnimatedNumber number={...} />;

General

See the example to get a full understanding of functionality.

Configure

number

Type: number Required

The value to be display

initial

Type: number Default: 0

The starting value that the intial animation will begin from

fps

Type: number Default: 60

The framerate of the animation. Note, this is a maximum, not a forced framerate.

duration

Type: number Default: 250

The duration of the animation in ms.

format

Type: (value: number): string | number;

A function to format the output of an animation. i.e. Math.round

component

Type: string Default: 'p'

The element to render the animated value with.

License

MIT © jhonnold