3.0.3 • Published 7 months ago

animate-styled v3.0.3

Weekly downloads
190
License
MIT
Repository
github
Last release
7 months ago

AnimateStyled

npm version npm MIT

small contribution for those who work with react and styled-components

AnimateStyled is just a library based on the great work done by the people of animate.css led to the stack of react and styled-components.

Installation

via yarn, just follow these simple commands:

$ yarn add animate-styled

or via npm:

$ npm install animate-styled --save

Basic use

import in your file js

...
import { AnimateStyled } from "animate-styled"
...
render(){
  return(
    <AnimateStyled name="hinge">
      <h1>Mi contenido</h1>   /* children is required */
    </AnimateStyled>
  )
}

Properties

Name propsDefaultTypeValues
nameshakeStringnames of animations
duration2sString1s, 300ms...
timingFunctionlinearStringease, ease-in, ease-out, ease-in-out, linear, step-start, step-end
delay0sString1s, 300ms...
iterationCountinfiniteString, Number0 , 1 , 3 , infinite
directionnormalStringnormal, reverse, alternate, alternate-reverse
fillModenoneStringnone, forwards, backwards, both
playStaterunningStringrunning, paused
transformOrigincenterStringcenter, 50%, top bottom, 10% 80% ...
backfaceVisibilityhiddenStringhidden, visible
opacity0Number0 -> 1
styleundefinedReact.CSSProperties
childrenHello WorldReactNode

Names of animations

For test all animation click here


Attention SeekersSpecialsFlippersLightSpeed
bouncehingefliplightSpeedInLeft
flashjackInTheBoxflipInXlightSpeedInRight
headShakerollInflipInYlightSpeedOutLeft
heartBeatrollOutflipOutXlightSpeedOutRight
jelloflipOutY
pulse
rubberBand
shake
shakeX
shakeY
swing
tada
wobble

BackEntrancesBackExitsBouncingEntrancesBouncingExits
backInDownbackOutDownbounceInbounceOut
backInLeftbackOutLeftbounceInDownbounceOutDown
backInRightbackOutRightbounceInLeftbounceOutLeft
backInUpbackOutUpbounceInRightbounceOutRight
bounceInUpbounceOutUp

FadingEntrancesFadingExitsRotatingEntrancesRotatingExits
fadeInfadeOutrotateInrotateOut
fadeInBottomLeftfadeOutBottomLeftrotateInDownLeftrotateOutDownLeft
fadeInBottomRightfadeOutBottomRightrotateInDownRightrotateOutDownRight
fadeInDownfadeOutDownrotateInUpLeftrotateOutUpLeft
fadeInDownBigfadeOutDownBigrotateInUpRightrotateOutUpRight
fadeInLeftfadeOutLeft
fadeInLeftBigfadeOutLeftBig
fadeInRightfadeOutRight
fadeInRightBigfadeOutRightBig
fadeInTopLeftfadeOutTopLeft
fadeInTopRightfadeOutTopRight
fadeInUpfadeOutUp
fadeInUpBigfadeOutUpBig

SlidingEntrancesSlidingExitsZoomingEntrancesZoomingExits
slideInDownslideOutDownzoomInzoomOut
slideInLeftslideOutLeftzoomInDownzoomOutDown
slideInRightslideOutRightzoomInLeftzoomOutLeft
slideInUpslideOutUpzoomInRightzoomOutRight
zoomInUpzoomOutUp

Import multiple animations

import { AnimateStyled } from "animate-styled";
...
render(){
  return(
    <div>
      <AnimateStyled name="rollIn">
        <h1>My Content</h1>
      </AnimateStyled>
      <AnimateStyled name="zoomOut">
        <p>My Content</p>
      </AnimateStyled>
      <AnimateStyled name="slideOutUp">
        <img src="image/logo.png"/>
      </AnimateStyled>
    </div>
  )
}

Using All Properties

<AnimateStyled
  name="flip"
  duration="600ms"
  timingFunction="ease-in-out"
  delay="200ms"
  iterationCount={3}
  direction="alternate"
  fillMode="forwards"
  playState="running"
  transformOrigin="center top"
  backfaceVisibility="visible"
>
  {children}
</AnimateStyled>

Other uses

Nesting

<AnimateStyled name="flip">
  <AnimateStyled
    name="zoomOutUp"  
    iterationCount="infinite"
    timingFunction="ease-in">
    <h1>  Mundo</h1>
  </AnimateStyled>
</AnimateStyled>

License

AnimateStyled is licensed under the MIT license. (http://opensource.org/licenses/MIT)

3.0.3

7 months ago

3.0.2

7 months ago

3.0.1

7 months ago

3.0.0

7 months ago

2.5.0

9 months ago

2.4.0

9 months ago

2.3.0

4 years ago

2.2.0

4 years ago

2.1.0

7 years ago

2.0.9

7 years ago

2.0.8

7 years ago

2.0.7

7 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.5

7 years ago

1.2.4

7 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago