Skip to content

Easing Functions

FunctionFamilyDescription
linearConstant speed, no acceleration
easeInQuadQuadraticAccelerates from zero
easeOutQuadQuadraticDecelerates to zero
easeInOutQuadQuadraticAccelerates then decelerates
easeInCubicCubicAccelerates from zero (steeper)
easeOutCubicCubicDecelerates to zero (steeper)
easeInOutCubicCubicAccelerates then decelerates (steeper)
easeInQuartQuarticStrong acceleration from zero
easeOutQuartQuarticStrong deceleration to zero
easeInOutQuartQuarticStrong acceleration then deceleration
easeInSineSineGentle acceleration from zero
easeOutSineSineGentle deceleration to zero
easeInOutSineSineGentle acceleration then deceleration
easeInExpoExponentialExplosive acceleration from zero
easeOutExpoExponentialExplosive deceleration to zero
easeInOutExpoExponentialExplosive acceleration then deceleration
easeInBackBackPulls back before accelerating
easeOutBackBackOvershoots then settles
easeInOutBackBackPulls back, overshoots, then settles
easeInElasticElasticSpring-like wind-up
easeOutElasticElasticSpring-like overshoot oscillation
easeInOutElasticElasticSpring-like on both ends
easeInBounceBounceBounces at the start
easeOutBounceBounceBounces at the end
easeInOutBounceBounceBounces at both ends

Define a custom cubic-bezier curve, matching the CSS cubic-bezier() syntax.

import { cubicBezier } from 'elucim';
const myEasing = cubicBezier(0.25, 0.1, 0.25, 1.0);

Physics-based spring easing.

import { spring } from 'elucim';
const mySpring = spring({ mass: 1, stiffness: 100, damping: 10 });
ParameterTypeDescription
massnumberMass of the object
stiffnessnumberSpring stiffness constant
dampingnumberFriction / damping coefficient
import { interpolate, easeOutCubic } from 'elucim';
const value = interpolate(progress, [0, 1], [0, 300], {
easing: easeOutCubic,
});
<Transform
from={{ translateX: -100 }}
to={{ translateX: 0 }}
duration={30}
easing={easeOutBack}
>
<Circle cx={200} cy={150} r={40} fill="#4f9eff" />
</Transform>
import { Player, Transform, Circle, easing } from '@elucim/core';
<Player width={500} height={250} fps={30} durationInFrames={90}>
<Transform
from={{ translateX: -150 }}
to={{ translateX: 150 }}
duration={60}
easing={easing.easeInOutCubic}
>
<Circle cx={250} cy={125} r={20} fill="#6c5ce7" />
</Transform>
</Player>