Socket
Socket
Sign inDemoInstall

react-simple-animate

Package Overview
Dependencies
Maintainers
2
Versions
181
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-animate

react simple animate


Version published
Weekly downloads
304K
increased by4.59%
Maintainers
2
Weekly downloads
 
Created

What is react-simple-animate?

react-simple-animate is a lightweight animation library for React that allows you to easily add animations to your components. It provides a simple API to animate elements with various effects such as transitions, keyframes, and more.

What are react-simple-animate's main functionalities?

Transition Animation

This feature allows you to animate the transition of an element's properties from a start state to an end state. In this example, the opacity of the div element transitions from 0 to 1, creating a fade-in effect.

```jsx
import React from 'react';
import { Animate } from 'react-simple-animate';

const TransitionExample = () => (
  <Animate
    play
    duration={1}
    start={{ opacity: 0 }}
    end={{ opacity: 1 }}
  >
    <div>Fade In</div>
  </Animate>
);

export default TransitionExample;
```

Keyframe Animation

This feature allows you to define keyframe animations, where you can specify multiple steps of an animation. In this example, the div element slides 100px to the right and then back to its original position.

```jsx
import React from 'react';
import { AnimateKeyframes } from 'react-simple-animate';

const KeyframeExample = () => (
  <AnimateKeyframes
    play
    duration={2}
    keyframes={[
      { 0: { transform: 'translateX(0)' } },
      { 50: { transform: 'translateX(100px)' } },
      { 100: { transform: 'translateX(0)' } }
    ]}
  >
    <div>Slide</div>
  </AnimateKeyframes>
);

export default KeyframeExample;
```

CSS Animation

This feature allows you to use CSS animations within the AnimateGroup component. In this example, a div element with a bounce animation is created using CSS keyframes.

```jsx
import React from 'react';
import { AnimateGroup } from 'react-simple-animate';

const CSSAnimationExample = () => (
  <AnimateGroup play>
    <div className="box" style={{ animation: 'bounce 2s infinite' }}>Bounce</div>
  </AnimateGroup>
);

export default CSSAnimationExample;

// CSS
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-30px); }
  60% { transform: translateY(-15px); }
}

.box {
  width: 100px;
  height: 100px;
  background-color: red;
}
```

Other packages similar to react-simple-animate

Keywords

FAQs

Package last updated on 02 Oct 2022

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