Giter Site home page Giter Site logo

cultureamp / react-animate-on-change Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arve0/react-animate-on-change

0.0 9.0 1.0 486 KB

Animate your components on state change

Home Page: https://www.npmjs.com/package/react-animate-on-change

JavaScript 99.90% HTML 0.04% CSS 0.07%

react-animate-on-change's Introduction

react-animate-on-change

Animate your react components on props or state changes, in contrast to entries added/removed from arrays.

Install

npm install react-animate-on-change react

Usage

const AnimateOnChange = require('react-animate-on-change')

// functional component
const Score = (props) =>
  <AnimateOnChange
    baseClassName="Score"
    animationClassName="Score--bounce"
    animate={props.diff != 0}>
      Score: {props.score}
  </AnimateOnChange>

The example above will (roughly) render to:

On enter or changes in props.diff or props.score:

<span class="Score Score--bounce">
  <span>Score: 100</span>
</span>

On animation end:

<span class="Score">
  <span>Score: 100</span>
</span>

Also, see the example folder.

Props

baseClassName {string} : Base class name that be added to the component.

animationClassName {string} : Animation class name. Added when animate == true. Removed when the event animationend is triggered.

animate {bool} : Wheter component should animate.

Develop

npm start

Add tests in test.js and hack away.

Known issues

  • The browser must support CSS3 animations, doh.

react-animate-on-change's People

Contributors

arve0 avatar chi-teck avatar ipurpl3x avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

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.