1.0.0 • Published 7 years ago

styled-animated v1.0.0

Weekly downloads
6
License
ISC
Repository
github
Last release
7 years ago

I was inspired by Animated.css

Live Demo

Actually, it doesn't make any difference with using css animations but composition is awesome, you can compose any animated elements maybe this can create a little difference.

Installation

npm install styled-animated styled-components --save

How to use it

With Animated component

import Animated, { zoomIn } from 'styled-animated'
...
<Animated animationFunction={zoomIn}>
    Styled-Animated
</Animated>
...

Without Animated component

import { zoomIn } from 'styled-animated'

...
<Rectangle>
   Styled-Animated
</Rectangle>
...

const Rectangle=styled.div`
   width:200px;
   height:200px;
   background-color:red;
   animation:${zoomIn} 1s ease-in;
`

Animated Component Props

propsdefaultexplanation
animationFunction (Required)-Animation name. You can use any present effect like zoomIn, fadeIn, etc.
duration1Animation time
timingFunctionlinearYou can use ease, linear, cubic-bezier
delay0A delay for the start of an animation.
iterationCountfiniteThe number of times an animation should run. You use number or string like "finite" or "infinite"
directionalternateThis is used to let animation run in reverse direction or alternate cycles