npm / animejs
animejs
What changed in animejs 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.
7 breaking18 new APIs and options3 performance2 behavior and defaults22 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initanimejs 452 changes
Breaking changes 7
Color animations blend RGB channels in pseudo-linear space for smoother, more even transitions; intermediate colors may differ from previous versions.
The DevTools integration has been removed.
Direct animation of
matrixis no longer supported; matrix values remain preserved when read from inline styles and can still be set using a transform string.Direct animation of
matrix3dis no longer supported; matrix values remain preserved when read from inline styles and can still be set using a transform string.The third argument to function-based value callbacks is now the targets array rather than the total target count; use
targets.lengthto get the count.The third argument to the stagger callback is now the targets array instead of the total count; use
targets.lengthto get the count.Transforms now render in a fixed order—perspective, translate, rotate, scale, then skew—regardless of the order in animation parameters.
New APIs and options 18
Adds a built-in Three.js adapter for animating Object3D, materials, lights, cameras, audio nodes, UniformNode, and instanced meshes.
Adds an API for extending animate() and utils.set() to non-DOM targets.
The axis parameter accepts 'z' for 3D grid origins.
The from parameter accepts normalized [x, y, z] coordinates for 3D grid origins.
Auto-grid mode supports 3D layouts using x, y, and z coordinates or an explicit columns, rows, and depth triplet.
Adds a jitter parameter for adding a random offset to staggered values, as a single number or a [start, end] range.
Adds a seed parameter to make jitter and from: 'random' reproducible.
The
addChildhelper is now exported fromutils.The
forEachChildrenhelper is now exported fromutils.The stagger
fromparameter accepts normalized[x, y]coordinate arrays from 0 to 1 for precise grid origin control.globalsis now exported from the main module entry point.Adds an editor hook system for an external editor to intercept
animate()andcreateTimeline()calls.Adds
grid: trueauto-grid mode, which computes a 2D layout from element positions or JS object coordinates without requiring explicit dimensions.createLayout()now accepts anidparameter.Function-based value callbacks receive a fourth argument with the previous sibling tween's computed end value for the same target and property.
Adds a parameter to control execution order within the engine tick loop for timers, animations, and timelines.
The
removeChildhelper is now exported fromutils.Adds a function-based value for animating text with a character-by-character scramble and reveal effect.
Performance 3
engine.speed updates are faster because unnecessary work is skipped when the value does not change.
engine.timeUnit updates are faster because unnecessary work is skipped when the value does not change.
Improves performance when building large timelines with many overlapping .add() calls on the same property and fixes a case where the timeline could cancel itself.
Behavior and default changes 2
The target type for
splitText()andTextSplitteris widened fromHTMLElementtoElement.Adjacent translate and scale axis properties are grouped into CSS shorthand forms, producing shorter transform strings.
Fixes and other changes 22
Fixes random flicker on alternate loops when duration values are non-integers.
Frame scheduling is more accurate and no longer drops frames arriving slightly early because of requestAnimationFrame jitter.
Fixes implicit from values resolving to stale values when an overridden tween occurs earlier in the chain.
Fixes a crash when a scroll container resizes before its target is ready.
Fixes floating point precision producing incorrect intermediate values in keyframe arrays.
Fixes backward scrubbing past the start of a keyframe sequence not restoring the first keyframe's from value.
Fixes forward scrubbing past the end of a keyframe sequence leaving the target at a previous keyframe's value.
Fixes sequential keyframes being detected as overlapping because of floating point drift, which could leave the target at the wrong value when scrubbing.
Function-based and CSS variable from values in { from, to } object form now re-resolve on refresh().
Fixes random flicker between iterations of reversed loops.
Fixes stretch() incorrectly scaling animations that use keyframes.
Fixes backward seeking leaving a timeline child at its end value when all its properties share the same delay.
Fixes a delayed timeline child overwriting a later sibling's value during a forward seek when its delay exceeds its duration.
Fixes stale values when seeking timelines whose children animate the same property through delayed tweens, especially with staggered jitter delays.
Fixed a regression where timeline call did not trigger properly in some cases.
addEffect()now returnsthiswhen the effect argument is not a function.Accessing a non-existent chainable method now returns
undefinedinstead of throwing an error.Parsing now handles multi-argument CSS transform functions and nested
calc()expressions.Tracked animations reconstructed during effect refresh now preserve
_startTime, preventing timing jumps.Scroll-controlled layout animations now properly call
onCompleteandonPausecallbacks.Chaining in keyframe arrays and timelines now produces the correct intermediate shapes.
revert()now restores object properties and DOM attributes to their original values as well as CSS styles and transforms.