Replies: 1 comment 1 reply
-
React Spring has some presets. Its documented on https://www.react-spring.io/docs/hooks/api in the "Presets" section. Nonetheless, you should bear in mind that React Spring uses so-called "spring" animations which are physics-based emulating the movement of spring rather than "easing-based" which are defined using a function of the rate of change during time. The "BounceIn", "SlideDownOut" and so on are different easing function which are not natively supported in React Spring. However, if you insist on not using physics-based animations and prefer "easing-based" ones, you can achieve that by passing a import * as easings from 'd3-ease'
// ...
// ...
useSpring({ opacity: toggle ? 1 : 0, config: { duration: 250, easing: easings.easeBounceIn }}) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Some react animation packages has predefined animations like "BounceIn", "SlideDownOut", etc.
Is there something similar in
react-spring
?Or is there a list shows animation name and example code as key:value pairs?
Beta Was this translation helpful? Give feedback.
All reactions