react-smooth
react-smooth is a animation library work on React.
install
npm install --save react-smooth
Usage
ordinary animation
<Animate ="0" ="opacity"> <div /></Animate>
steps animation
const steps = style: opacity: 0 moment: 400 style: opacity: 1 transform: 'translate(0, 0)' moment: 1000 style: transform: 'translate(100px, 100px)' moment: 1200; <Animate => <div /></Animate>
children can be a function
<Animate = = ="ease-in" > opacity <div =></div> </Animate>
you can configure js timing function
const easing = ;const easing = ;
group animation
const appear = from: 0 to: 1 attributeName: 'opacity'; const leave = steps: moment: 0 style: transform: 'translateX(0)' moment: 1000 style: transform: 'translateX(300)' height: 50 moment: 2000 style: height: 0 <AnimateGroup = => list </AnimateGroup>
API
Animate
name | type | default | description |
---|---|---|---|
from | string or object | '' | set the initial style of the children |
to | string or object | '' | set the final style of the children |
canBegin | boolean | true | whether the animation is start |
begin | number | 0 | animation delay time |
duration | number | 1000 | animation duration |
steps | array | [] | animation keyframes |
onAnimationEnd | function | () => {} | called when animation finished |
attributeName | string | '' | style property |
easing | string | 'ease' | the animation timing function, support css timing function temporary |
isActive | boolean | true | whether the animation is active |
children | element | support only child temporary |
AnimateGroup
name | type | default | description |
---|---|---|---|
appear | object | undefined | configure element appear animation |
enter | object | undefined | configure element appear animation |
leave | object | undefined | configure element appear animation |
License
Copyright (c) 2015-2016 Recharts Group