rc-animate
css-transition ui component for react
Last updated 8 years ago by zombiej .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install rc-animate 
SYNC missed versions from official npm registry.

rc-animate


animate react element easily

NPM version build status Test coverage gemnasium deps node version npm download

Feature

  • support ie8,ie8+,chrome,firefox,safari

install

rc-animate

Usage

import Animate from 'rc-animate';

ReactDOM.render(
  <Animate animation={{ ... }}>
    <p key="1">1</p>
    <p key="2">2</p>
  </Animate>
, mountNode);

CSSMotion

props

Property Type Default Description
visible boolean true Display child content or not
children function Render props of children content. Example [see below](#sample usage)
motionName string | motionNameObjProps Set the className when motion start
motionAppear boolean true Support motion on appear
motionEnter boolean true Support motion on enter
motionLeave boolean true Support motion on leave
onAppearStart function Trigger when appear start
onAppearActive function Trigger when appear active
onAppearEnd function Trigger when appear end
onEnterStart function Trigger when enter start
onEnterActive function Trigger when enter active
onEnterEnd function Trigger when enter end
onLeaveStart function Trigger when leave start
onLeaveActive function Trigger when leave active
onLeaveEnd function Trigger when leave end

motionNameObjProps

Property Type
appear string
appearActive string
enter string
enterActive string
leave string
leaveActive string

sample usage

// Return customize style
const onAppearStart = (ele) => ({ height: 0 });

<CSSMotion
  visible={show}
  transitionName="transition"
  onAppearStart={onAppearStart}
>
  {({ style, className }) => (
    <div className={className} style={style} />
  )}
</CSSMotion>

Animate (Deprecated)

props

name type default description
component React.Element/String 'span' wrap dom node or component for children. set to '' if you do not wrap for only one child
componentProps Object {} extra props that will be passed to component
showProp String using prop for show and hide. [demo](http://react-component.github.io/animate/examples/hide-todo.html)
exclusive Boolean whether allow only one set of animations(enter and leave) at the same time.
transitionName String|Object specify corresponding css, see ReactCSSTransitionGroup
transitionAppear Boolean false whether support transition appear anim
transitionEnter Boolean true whether support transition enter anim
transitionLeave Boolean true whether support transition leave anim
onEnd function(key:String, exists:Boolean) true animation end callback
animation Object {} 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.

Current Tags

  • 2.6.0-beta.1                                ...           beta (8 years ago)
  • 3.1.1                                ...           latest (6 years ago)

68 Versions

  • 3.1.1                                ...           6 years ago
  • 3.1.0                                ...           7 years ago
  • 3.0.0                                ...           7 years ago
  • 2.11.1                                ...           7 years ago
  • 2.11.0                                ...           7 years ago
  • 2.10.3                                ...           7 years ago
  • 2.10.2                                ...           7 years ago
  • 2.10.1                                ...           7 years ago
  • 2.10.0                                ...           7 years ago
  • 2.9.2                                ...           7 years ago
  • 2.9.1                                ...           7 years ago
  • 2.9.0                                ...           7 years ago
  • 2.8.3                                ...           8 years ago
  • 2.8.2                                ...           8 years ago
  • 2.8.1                                ...           8 years ago
  • 2.8.0                                ...           8 years ago
  • 2.7.0                                ...           8 years ago
  • 2.6.0                                ...           8 years ago
  • 2.5.4                                ...           8 years ago
  • 2.6.0-beta.1                                ...           8 years ago
  • 2.5.3                                ...           8 years ago
  • 2.5.2                                ...           8 years ago
  • 2.5.1                                ...           8 years ago
  • 2.5.0                                ...           8 years ago
  • 3.0.0-rc.6                                ...           8 years ago
  • 3.0.0-rc.5                                ...           8 years ago
  • 3.0.0-rc.4                                ...           8 years ago
  • 3.0.0-rc.3                                ...           8 years ago
  • 3.0.0-rc.2                                ...           8 years ago
  • 3.0.0-rc.1                                ...           8 years ago
  • 3.0.0-rc.0                                ...           8 years ago
  • 2.4.4                                ...           9 years ago
  • 2.4.3                                ...           9 years ago
  • 2.4.1                                ...           9 years ago
  • 2.4.0                                ...           9 years ago
  • 2.3.6                                ...           10 years ago
  • 2.3.5                                ...           10 years ago
  • 2.3.4                                ...           10 years ago
  • 2.3.3                                ...           10 years ago
  • 2.3.1                                ...           10 years ago
  • 2.3.0                                ...           10 years ago
  • 2.2.2                                ...           10 years ago
  • 2.2.1                                ...           10 years ago
  • 2.2.0                                ...           10 years ago
  • 2.1.0                                ...           10 years ago
  • 2.0.4                                ...           11 years ago
  • 2.0.3                                ...           11 years ago
  • 2.0.2                                ...           11 years ago
  • 2.0.1                                ...           11 years ago
  • 2.0.0                                ...           11 years ago
  • 1.3.0                                ...           11 years ago
  • 1.2.9                                ...           11 years ago
  • 1.2.8                                ...           11 years ago
  • 1.2.7                                ...           11 years ago
  • 1.2.6                                ...           11 years ago
  • 1.2.5                                ...           11 years ago
  • 1.2.4                                ...           11 years ago
  • 1.2.3                                ...           11 years ago
  • 1.2.2                                ...           11 years ago
  • 1.2.1                                ...           11 years ago
  • 1.2.0                                ...           11 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.5                                ...           11 years ago
  • 1.0.4                                ...           11 years ago
  • 1.0.3                                ...           11 years ago
  • 1.0.2                                ...           11 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
Downloads
Total 169
Today 0
This Week 0
This Month 67
Last Day 0
Last Week 2
Last Month 4
Dependencies (8)
Dev Dependencies (9)

© 2010 - cnpmjs.org x YWFE | Home | YWFE