2.0.4 • Published 8 months ago

@hardiknaik/react-number-scroll v2.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

react-number-scroll

groww style number animation

ezgif com-gif-maker

NPM JavaScript Style Guide

Install

npm i @hardiknaik/react-number-scroll

Usage

Functional Component

import React from "react";
import { NumberScroll } from "@hardiknaik/react-number-scroll";

const App = () => {
  return (
    <NumberScroll
      number={444} // specify the number
      className="text-yellow" // specify the Class name (Optional)
      style={{ background: "red" }} // specify the Style (Optional)
      decimal={2} // specify the Decimal Places default to 0 (Optional)
    />
  );
};

export default App;

Class Component

import React, { Component } from "react";
import { NumberScroll } from "@hardiknaik/react-number-scroll";

class Example extends Component {
  render() {
    return (
      <NumberScroll
        number={444} // specify the number
        className="text-yellow" // specify the Class name (Optional)
        style={{ background: "red" }} // specify the Style (Optional)
        decimal={2} // specify the Decimal Places default to 0 (Optional)
      />
    );
  }
}

Options details

Available options with example values:

<NumberScroll
  number={444}
  className="text-yellow"
  style={{ background: "red" }}
  decimal={2}
/>
ParameterTypeRequiredDefaultsDescription
numberNumberyes-Provide the number you want to animate.
classNameStringno-Provide the Class Name.
styleCSS Objectno-Provide the Style.
decimalNumberno0Provide the Decimal places you want to show to the number.

License

MIT © Hardik Naik

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

2.0.3

8 months ago

2.0.2

8 months ago

2.0.4

8 months ago

2.0.1

8 months ago

2.0.0

8 months ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago