react-increment-number

0.1.3 • Public • Published

Number Increment Animation

React number increment animation component

install

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

DEMO

use

import { useState } from 'react'
import IncrementNumber from "react-increment-number";

const [number, setNumber] = useState(0)
const [speed, setSpeed] = useState(5)

const handleAnimationEnd = (endValue: number) => {
    console.log('animation end', endValue)
}
// to: target number(value must be a number)
// speed: animation speed(1-10) and default value is 5;
<template>
    <IncrementNumber to={number} speed={speed} callback={handleAnimationEnd} />
</template>

Package Sidebar

Install

npm i react-increment-number

Weekly Downloads

3

Version

0.1.3

License

none

Unpacked Size

38.5 kB

Total Files

4

Last publish

Collaborators

  • cashon