Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-animate

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-animate

css-transition ui component for react

  • 1.2.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
644K
increased by3.9%
Maintainers
2
Weekly downloads
 
Created

What is rc-animate?

The rc-animate package is a React component for creating animations. It provides a simple way to animate elements as they enter and leave the DOM, making it useful for creating dynamic and interactive user interfaces.

What are rc-animate's main functionalities?

Basic Animation

This example demonstrates a basic animation using rc-animate. When the button is clicked, the 'Hello World' box will fade in and out.

const React = require('react');
const ReactDOM = require('react-dom');
const Animate = require('rc-animate');

class App extends React.Component {
  state = { show: true };

  toggle = () => {
    this.setState({ show: !this.state.show });
  };

  render() {
    return (
      <div>
        <button onClick={this.toggle}>Toggle</button>
        <Animate transitionName="fade">
          {this.state.show ? <div key="1" className="box">Hello World</div> : null}
        </Animate>
      </div>
    );
  }
}

ReactDOM.render(<App />, document.getElementById('root'));

Custom Animation

This example shows how to use custom CSS classes for animations. The 'custom-enter' and 'custom-leave' classes can be defined in your CSS to create custom animations.

const React = require('react');
const ReactDOM = require('react-dom');
const Animate = require('rc-animate');

class App extends React.Component {
  state = { show: true };

  toggle = () => {
    this.setState({ show: !this.state.show });
  };

  render() {
    return (
      <div>
        <button onClick={this.toggle}>Toggle</button>
        <Animate
          transitionName={{
            enter: 'custom-enter',
            leave: 'custom-leave'
          }}
        >
          {this.state.show ? <div key="1" className="box">Hello World</div> : null}
        </Animate>
      </div>
    );
  }
}

ReactDOM.render(<App />, document.getElementById('root'));

Other packages similar to rc-animate

Keywords

FAQs

Package last updated on 26 Aug 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc