React AnimateCSS v0.4.1

React AnimateCSS documentation and playground

Edit page
All animationsChangelogCode of conduct
Components
Get StartedRequirementsInstallationCombineonAnimationEndMix your animationAgnostic HTML tagDisplay blockComplete exampleCredits

Get Started

Requirements

  • node
  • yarn

Installation

You can use either npm

npm i @gfazioli/react-animatecss

or yarn

yarn add @gfazioli/react-animatecss

Combine

Of course, you can combine different animation effects as well

<Zoom animate={both} onAnimationEnd={() => setBoth(false)}>
<RubberBand animate={both} onAnimationEnd={() => setBoth(false)}>
<h1>RubberBand + Zoom</h1>
</RubberBand>
</Zoom>

onAnimationEnd

You may use the onAnimationEnd event to detect when an animation is completed. This is useful to reset the animate prop

Mix your animation

Agnostic HTML tag

Currently, the default container for all animations is a span with display: inline-block. You may easly override this behaviour by using the as property:

Say Hello to React
AnimateCSS

Say Hello to React

AnimateCSS

Display block

Now, you can override the display: inline-bock in two ways. The first on is by using the new propery block

Say Hello to React AnimateCSS

The above will display a span in display: bock. You may also use the styled-component:

const BounceAnimation = styled(Bounce).attrs({ as: "div" })`
display: block;
`;

See demo below

Complete example

Say Hello to React AnimateCSS

Credits

This package is based of Animate.css