Skip to content

Repository files navigation

rc-animate


Animate React Component easily.

NPM versionbuild statusTest coverageDependenciesDevDependenciesnpm downloadbundle size

Install

rc-animate

Usage

importAnimatefrom'rc-animate';exportdefault()=>(<Animateanimation={{ ... }}><pkey="1">1</p><pkey="2">2</p></Animate>);

Compatibility

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Electron
Electron
IE11, Edgelast 2 versionslast 2 versionslast 2 versionslast 2 versions

API

props

nametypedefaultdescription
componentReact.Element/String'span'wrap dom node or component for children. set to '' if you do not wrap for only one child
componentPropsObject{}extra props that will be passed to component
showPropStringusing prop for show and hide. [demo](http://react-component.github.io/animate/examples/hide-todo.html)
exclusiveBooleanwhether allow only one set of animations(enter and leave) at the same time.
transitionNameString|Objectspecify corresponding css, see ReactCSSTransitionGroup
transitionAppearBooleanfalsewhether support transition appear anim
transitionEnterBooleantruewhether support transition enter anim
transitionLeaveBooleantruewhether support transition leave anim
onEndfunction(key:String, exists:Boolean)trueanimation end callback
animationObject{} to animate with js. see animation format below.

animation format

with appear, enter and leave as keys. for example:

{appear: function(node,done){node.style.display='none';$(node).slideUp(done);return{stop:function(){// jq will call done on finish$(node).stop(true);}};},enter: function(){this.appear.apply(this,arguments);},leave: function(node,done){node.style.display='';$(node).slideDown(done);return{stop:function(){// jq will call done on finish$(node).stop(true);}};}}

Development

npm install
npm start

Example

http://localhost:8200/examples/index.md

online example: http://react-component.github.io/animate/examples/

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rc-animate is released under the MIT license.

About

anim react element easily

Resources

Stars

677 stars

Watchers

28 watching

Forks

Releases

Packages

Used by

Contributors

Languages