FlipMove supports CSS-based enter/leave animations. For convenience, several presets are provided:
<FlipMove enterAnimation="elevator" leaveAnimation="elevator" />
<FlipMove enterAnimation="fade" leaveAnimation="fade" />
<FlipMove enterAnimation="accordionVertical" leaveAnimation="accordionVertical" />
<FlipMove enterAnimation="accordionHorizontal" leaveAnimation="accordionHorizontal" />
You can supply your own CSS-based transitions to customize the behaviour. Both enterAnimation
and leaveAnimation
take an object with from
and to
properties. You can then provide any valid CSS properties to this object, although for performance reasons it is recommended that you stick to transform
and opacity
.
<FlipMove
staggerDelayBy={150}
enterAnimation={{
from: {
transform: 'rotateX(180deg)',
opacity: 0.1,
},
to: {
transform: '',
},
}}
leaveAnimation={{
from: {
transform: '',
},
to: {
transform: 'rotateX(-120deg)',
opacity: 0.1,
},
}}
>
{this.renderRows()}
</FlipMove>
enterAnimation
will not fire for the initial render. If you want your items to animate on mount, you'll have to use appearAnimation
.
It functions identically to enterAnimation
, and has the same presets.
For example:
<FlipMove
staggerDelayBy={150}
appearAnimation="accordionVertical"
enterAnimation="fade"
leaveAnimation="fade"
>
{this.renderRows()}
</FlipMove>