Skip to content

alexdriaguine/react-counter

This branch is 5 commits ahead of beanloop/react-counter:master.

Repository files navigation

react-counter

NPM JavaScript Style Guide

Install

npm install --save @beanloop-ab/react-counter

Usage

import * as React from 'react'

import {Counter} from 'react-counter'

class Example extends React.Component {
  render() {
    return (
      <div>
        <Counter from={500} to={1600} duration={2000} />
        <Counter to={1000} duration={2000} easing={n => n * n} />
        <Counter to={1000} duration={2000} easing={n => n} />
        <Counter to={1000}>
          {value => (
            <p style={{color: 'red'}}>
              {value} custom formatting with render prop
            </p>
          )}
        </Counter>
      </div>
    )
  }
}

License

MIT © Beanloop, Jakob Miland

About

Simple incremental counter with easings

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%