All Projects β†’ Leocardoso94 β†’ animated-number-react

Leocardoso94 / animated-number-react

Licence: MIT license
Super easy way to animate numbers with React

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to animated-number-react

React Animations
🎊 A collection of animations for inline style libraries
Stars: ✭ 2,978 (+3172.53%)
Mutual labels:  react-animations
React Flow
Highly customizable library for building interactive node-based UIs, editors, flow charts and diagrams
Stars: ✭ 8,348 (+9073.63%)
Mutual labels:  react-library
react-simple-star-rating
A simple react component for adding a star rating to your project.
Stars: ✭ 74 (-18.68%)
Mutual labels:  react-library
react-loading-icons
A TypeScript-React edition of Sam Herbert's amazing SVG Loaders.
Stars: ✭ 32 (-64.84%)
Mutual labels:  react-library
awesome-libraries-resources
Awesome js and css libraries for web development.
Stars: ✭ 32 (-64.84%)
Mutual labels:  react-library
Semantic Ui React
The official Semantic-UI-React integration
Stars: ✭ 12,561 (+13703.3%)
Mutual labels:  react-library
DeveloperFolio
A DevFolio/Developer Portfolio built using ReactJs and Animation libraries.
Stars: ✭ 51 (-43.96%)
Mutual labels:  react-animations
ui-glassmorphism
πŸ“˜ React component library on 'glassmorphism' UI/UX trend.
Stars: ✭ 20 (-78.02%)
Mutual labels:  react-library
react-emotion-multi-step-form
React multi-step form library with Emotion styling
Stars: ✭ 25 (-72.53%)
Mutual labels:  react-library
react-semantic-render
Semantic helper components for rendering content with React.
Stars: ✭ 13 (-85.71%)
Mutual labels:  react-library
create-chakra-icons
Transform SVGs to React Chakra UI <Icon /> ✨
Stars: ✭ 80 (-12.09%)
Mutual labels:  react-library
stan
πŸ”¨ Collection of front-end engineering tools
Stars: ✭ 19 (-79.12%)
Mutual labels:  react-library
reoil
🧑Reoil is a low-level react original component library which can be used as wapper to replace <div> <img> etc, also can be wrapper for any other components."
Stars: ✭ 26 (-71.43%)
Mutual labels:  react-library
React Interactive Paycard
Interactive React Paycard
Stars: ✭ 2,129 (+2239.56%)
Mutual labels:  react-animations
react-timepicker
React timepicker in Android KitKat style
Stars: ✭ 23 (-74.73%)
Mutual labels:  react-library
react-native-bouncing-ball
react native component bouncing ball for iOS and Android
Stars: ✭ 36 (-60.44%)
Mutual labels:  react-animations
Reactcss
πŸ’„ Inline Styles in JS
Stars: ✭ 1,603 (+1661.54%)
Mutual labels:  react-library
lmth
πŸ‘‹ WIP: Say good-bye to HTML, a document markup which is not for applications.
Stars: ✭ 37 (-59.34%)
Mutual labels:  react-library
useCustomHooks
πŸ“¦ npm package containing a set of custom hooks for your next React project.
Stars: ✭ 12 (-86.81%)
Mutual labels:  react-library
react-native-tus-client
React Native client for the tus resumable upload protocol.
Stars: ✭ 38 (-58.24%)
Mutual labels:  react-library

animated-number-react

npm Build Status

A simple animated number for React, using anime.

Live demo here

Usage

$ npm install animated-number-react
# OR
$ yarn add animated-number-react
import AnimatedNumber from "animated-number-react";

export default class App extends Component {
  state = {
    value: 150,
  };
  handleChange = ({ target: { value } }) => {
    this.setState({ value });
  };
  formatValue = (value) => value.toFixed(2);
  render() {
    return (
      <div>
        <input
          type="number"
          onChange={this.handleChange}
          value={this.state.value}
        />
        <AnimatedNumber
          value={this.state.value}
          formatValue={this.formatValue}
        />
      </div>
    );
  }
}

View demo here Edit animated-number-react

Props

Following props are used while initialization

Note : Only value is a required prop. Others are optional

Prop Name Type Description Default Value
value (required) [ Number, String] number that will be animated
duration (optional) Number the duration of animation 1000
delay (optional) Number the delay of animation 0
className (optional) String an className to add to the span null
easing (optional) String you can found all valid values here 'linear'

Callbacks props

Execute a function at the beginning, during or when an animation or timeline is completed.

Names Types Arguments Info
formatValue Function value Number A function that will manipulate the animated value
update Function animation Object Called at time = 0
run Function animation Object Called after delay is finished
begin Function animation Object Called after animation delay is over
complete Function animation Object Called only after all the loops are completed

Format Value

formatValue() is used to format the animatedValue.

Update

update() is called on every frame while the instance is playing.

Begin

begin() is called once after the delay is finished.

Check if the animation has begun with myAnimation.began, return true or false.

Run

run() is called every frame after the delay is finished.

Complete

complete() is called once after the animation is finished.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].