// Usage
spring(value, options);
// Simple spring animation to a value
spring(100);
// Tweaking the animations using stiffness & damping
spring(100, {
stiffness: 50,
damping: 50,
});
Stiffness
The amount of force acting on the object
Greater the value, the faster the animation
Damping
The amount of resistance the object applies
Lower the value, the bouncier the animation
<Motion />
<Motion
defaultStyle={{
x: 0,
}}
style={{
x: spring(100)
}}
>
{
(interpolatedStyle) => {
// do something with the interpolatedStyle
}
}
</Motion>