0.0.14 • Published 2 years ago

react-number-increment v0.0.14

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

React Number Increment

GitHub license Version Downloads

A configurable React component For counting up the number in your React appilcation. react-number-increment.

Animated Gif of Counter

Installation

yarn add react-number-increment
npm install react-number-increment

Import

import Counter from "react-number-increment";

Simple example

<Counter />

This will start a count up transition from 0 to 100 on render with speed of 1ms.

Example

// import "./App.css";
import Counter from "react-number-increment";

function App() {
  return (
    <div className="App">
      <Counter
        start=0 // starting
        end=500 // ends
        speed=1 // 100ms
        decrement // in case if you want to decrement
        style={{ fontSize: "200px", fontWeight: 900 }} // add custom style
        threshold=1 // viewport 1=100%,
        child="+" // add childs ie + , - , *
        offset=5 // increments by 5
        seperate="," // seperates number in comma
       />
    </div>
  );
}

export default App;

Note that offsetend={4} will add the offset to the ending value.

Add end and starting Number

<Counter offsetend={4} speed={10} end={10} />

Tip: If you need to start the render prop component immediately, you can set speed={0}.

If you know about default values 👍

keyValueGuide / What they does
start0Starting value
end100Ending value
speed11 is 100ms speed.
decrement0pass to decrement
offsetend0Adds the value in end
threshold.51 = 100%
child"+"100- , 2000, "-", ""
offsetnull5 // increments by 5
seperatenull"," - 10,900
License ISC
0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago