Giter Site home page Giter Site logo

javierbyte / react-number-easing Goto Github PK

View Code? Open in Web Editor NEW
152.0 7.0 23.0 2.51 MB

React component to interpolate rendering of numbers in the frontend.

Home Page: https://javier.xyz/react-number-easing/

License: BSD 3-Clause "New" or "Revised" License

JavaScript 74.73% HTML 25.27%
react frontend animation react-number-easing transition easing design-tool

react-number-easing's Introduction

React component for fancy number transitions.

โ€บ Online Demo.

react-number-easing screenshot

Installation

npm install react-number-easing --save

Usage.

import NumberEasing from 'react-number-easing';

<NumberEasing
  value={15}
  speed={300}
  decimals={0}
  ease='quintInOut' />

Props

  • value: The value that you want to display at the end of the animation. This is the target value.
  • [speed]: How fast do you want to finish the animation? Defaults to 500ms.
  • [ease]: The easing equation for the animation. Defaults to quintInOut. You can choose from mattdesl/eases.
  • [decimals]: Number of decimal numbers to show.
  • [customFunctionRender]: Function that replaces the default Number(value).toString(decimals) render function. It takes one argument currentRenderValue which is a Float with the current eased value to render and should return a string.

react-number-easing's People

Contributors

adjohu avatar javierbyte avatar migreva avatar piotr-cz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-number-easing's Issues

Continued support

Despite this widget being broken in the latest versions of React, it looks like there is still a small but present need for this tool to be maintained among some. Any chance you might think about adding some maintainers for this, if you're too busy? Happy to chip in myself.

Feature: possibility to have a different format when target is reached

Hello,

Transitioning tons of decimals is not that great for us but we still would like to show them when the transition has finished. So ideally I'd like to have 0 decimals during transitions then final value has some. What do you think?

Thanks for the component by the way : )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.