11# [ React Number Easing] ( http://javierbyte.github.io/react-number-easing/ )
2- [ ![ Rate on Openbase] ( https://badges.openbase.com/js/rating/che-react-number-easing.svg )] ( https://openbase.com/js/che-react-number-easing?utm_source=embedded&utm_medium=badge&utm_campaign=rate-badge )
32
43React component for fancy number transitions.
54
65[ Live demo] ( https://che-wf.github.io/react-number-easing/ )
76
87[ ![ react-number-easing screenshot] ( assets/number-easing-infinite.gif )] ( https://che-wf.github.io/react-number-easing/ )
98
10-
119## Installation
1210
1311``` js
1412npm i - S che- react- number- easing
1513```
1614
17- ## Usage.
15+ ## Usage
1816
1917``` jsx
20- const NumberEasing = require ( ' che-react-number-easing' ) ;
18+ import { NumberEasing } from " che-react-number-easing" ;
2119
2220< NumberEasing
2321 ease= " quintInOut"
@@ -26,41 +24,55 @@ const NumberEasing = require('che-react-number-easing');
2624 trail= {true }
2725 useLocaleString= {true }
2826 value= {15 }
29- / >
27+ / > ;
3028```
3129
3230### Props
3331
34- * ` [ease] ` : The easing equation for the animation.
35- * Default: ` quintInOut ` (You can choose from [ mattdesl/eases] ( https://github.com/mattdesl/eases/blob/master/index.js ) .)
36- * Type: ` string `
37- * ` [precision] ` : How many decimal places you want to show?
38- * Default: ` 2 `
39- * Type: ` number `
40- * ` [speed] ` : How fast do you want to finish the animation?
41- * Default:` 500 ` (ms)
42- * Type: ` number `
43- * ` [trail] ` : Do you want trailing zeroes?
44- * Default: ` false `
45- * Type: ` boolean `
46- * ` [useLocaleString] ` : Use number formatting based on locale?
47- * Default: ` false `
48- * Type: ` boolean `
49- * ` [value] ` : The value that you want to display at the end of the animation.
50- * ` Required `
51- * Type: ` number `
52-
53- # Build
54-
55- If you want to build this from source, you will need babel and less.
56-
57- ``` js
32+ - ` [ease] ` : The easing equation for the animation.
33+ - Default: ` quintInOut ` (You can choose from [ mattdesl/eases] ( https://github.com/mattdesl/eases/blob/master/index.js ) .)
34+ - Type: ` string `
35+ - ` [precision] ` : How many decimal places you want to show?
36+ - Default: ` 2 `
37+ - Type: ` number `
38+ - ` [speed] ` : How fast do you want to finish the animation?
39+ - Default:` 500 ` (ms)
40+ - Type: ` number `
41+ - ` [trail] ` : Do you want trailing zeroes?
42+ - Default: ` false `
43+ - Type: ` boolean `
44+ - ` [useLocaleString] ` : Use number formatting based on locale?
45+ - Default: ` false `
46+ - Type: ` boolean `
47+ - ` [value] ` : The value that you want to display at the end of the animation.
48+ - ` Required `
49+ - Type: ` number `
50+
51+ ## Requirements
52+
53+ - React 18 or newer
54+
55+ ## Build
56+
57+ To build from source:
58+
59+ ``` sh
5860npm install
61+ npm run build
5962```
6063
61- And run the pre publish script
64+ ## Test
6265
63- ``` js
64- npm run prepare
66+ To run tests:
67+
68+ ``` sh
69+ npm test
6570```
71+
6672[ ![ HitCount] ( http://hits.dwyl.com/{username}/che-wf/react-number-easing.svg )] ( http://hits.dwyl.com/{username}/che-wf/react-number-easing )
73+
74+ ## Project Structure
75+
76+ - Main component: ` src/components/NumberEasing.jsx `
77+ - All components are exported from ` src/index.jsx `
78+ [ ![ HitCount] ( http://hits.dwyl.com/{username}/che-wf/react-number-easing.svg )] ( http://hits.dwyl.com/{username}/che-wf/react-number-easing )
0 commit comments