Socket
Socket
Sign inDemoInstall

rc-animate

Package Overview
Dependencies
29
Maintainers
3
Versions
68
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rc-animate

css-transition ui component for react


Version published
Weekly downloads
590K
increased by2.31%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

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

PropertyTypeDefaultDescription
visiblebooleantrueDisplay child content or not
childrenfunctionRender props of children content. Example [see below](#sample usage)
motionNamestring | motionNameObjPropsSet the className when motion start
motionAppearbooleantrueSupport motion on appear
motionEnterbooleantrueSupport motion on enter
motionLeavebooleantrueSupport motion on leave
onAppearStartfunctionTrigger when appear start
onAppearActivefunctionTrigger when appear active
onAppearEndfunctionTrigger when appear end
onEnterStartfunctionTrigger when enter start
onEnterActivefunctionTrigger when enter active
onEnterEndfunctionTrigger when enter end
onLeaveStartfunctionTrigger when leave start
onLeaveActivefunctionTrigger when leave active
onLeaveEndfunctionTrigger when leave end
motionNameObjProps
PropertyType
appearstring
appearActivestring
enterstring
enterActivestring
leavestring
leaveActivestring

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

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.

Keywords

FAQs

Last updated on 31 Jul 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc