Skip to content

Easing Functions

Easing functions control the rate of change over time. Use them with interpolate() for non-linear animations.

Usage

jsx
import { Easing, interpolate, useCurrentFrame } from 'framely';

function EasedAnimation() {
  const frame = useCurrentFrame();

  const y = interpolate(frame, [0, 30], [100, 0], {
    easing: Easing.easeOutCubic,
  });

  return <div style={{ transform: `translateY(${y}px)` }} />;
}

Available Functions

FunctionDescription
Easing.linearNo easing, constant speed
Easing.easeInSlow start
Easing.easeOutSlow end
Easing.easeInOutSlow start and end
Easing.easeInCubicCubic slow start
Easing.easeOutCubicCubic slow end
Easing.easeInOutCubicCubic slow start and end
Easing.easeInBackSlight overshoot at start
Easing.easeOutBackSlight overshoot at end
Easing.bounceBouncing effect
Easing.springSpring-like motion

Custom Bezier

Create custom easing with Easing.bezier():

jsx
const easing = Easing.bezier(0.25, 0.1, 0.25, 1);

const value = interpolate(frame, [0, 60], [0, 1], { easing });

Released under the MIT License.