npm / animejs
animejs
What changed in animejs 3 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
18 breaking75 new APIs and options4 performance9 behavior and defaults1 tooling42 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initanimejs 4119 changes
Breaking changes 9
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.
The default composition is replace, overriding existing animations.
The rewrite includes improved performance.
New APIs and options 63
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.
Adds an onResize callback that triggers when the scroll container refreshes due to a resize event.
Adds
muteCallbacksto.complete()so an animation can complete without triggering callbacks.Adds a parameter to disable animation composition when using
.add()and improve performance.Adds a method to animate between two layout states.
Controls whether animations replace, blend with, or run independently of existing animations.
Adds control over an animation's maximum fps.
Adds object syntax for defining a tween's from and to values and easing.
Adds a more flexible keyframes system with tween-value, tween-parameter, duration-based, and percentage-based syntaxes.
Adds a function for transforming animation values during render.
Adds a callback invoked before each animation update.
Adds a callback triggered when an animation completes an iteration.
Adds a callback invoked when an animation is paused manually or interrupted by another animation.
Adds a callback triggered when animation values are updated and applied.
Applies easing to overall animation progress.
Executes a callback at a timeline position.
Immediately completes an animation.
Efficiently animates target properties, suited to frequently changing values such as cursor events or animation loops.
Adds draggable capabilities to DOM elements with physics, constraints, and callbacks.
Adds scopes for media-query reactions, custom root elements, shared defaults, and batch reversion.
Adds a spring API with object parameters.
Adds a dedicated defaults parameter for defining timeline child defaults.
Creates timers that schedule and control timed callbacks, keeping them in sync with animations.
Animations now support CSS variables.
Sets default animation parameters globally.
Controls whether animations pause when the tab is inactive.
Controls decimal precision for animated values globally.
Chooses between seconds and milliseconds for engine time units.
Adds a parameterized power easing function.
Adds random stepped easing.
Creates named timeline markers for referencing.
Adds multi-point linear interpolation easing.
Triggers and synchronizes Timer, Animation, and Timeline instances on scroll.
Updates all function-based animation values with new states.
Removes specific animations from a timeline.
Restores all animated properties to their original values.
Sets properties instantly at a timeline position.
Scales an animation to a new duration.
Adds control over SVG path drawing.
Adds the ability to move elements along SVG paths.
Adds SVG shape morphing between paths.
Synchronizes an external animation with a timeline.
Adds simpler Promise handling for animations.
Adds label references, previous-animation references, and relative positions for timeline positions.
Adds chainable utility functions for DOM manipulation, math operations, and animation helpers.
Creates native browser WAAPI-powered animations with the simplicity of Anime.js.
Performance 4
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.
Increases the engine's maximum fps to 240 from 120.
Behavior and default changes 6
The target type for
splitText()andTextSplitteris widened fromHTMLElementtoElement.Adjacent translate and scale axis properties are grouped into CSS shorthand forms, producing shorter transform strings.
Synced WAAPI animations now automatically have their persist property set to true.
The
easeparameter now accepts function-based values, likedurationanddelayproperties.Animations now support hex colors with an alpha channel.
The stagger function can now be used as a timeline time position.
Fixes and other changes 37
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.Auto Layout now properly syncs with onScroll, allowing layout animations to be controlled by scroll progress.
Fixes a regression so CSS computed style for background is correctly interpreted as a color value.
Fixes a regression that prevented inline elements from being animated in some cases with Auto Layout.
Fixes comment syntax that could potentially cause an error.
Function-based from values now refresh correctly when calling refresh().
Unit conversion is recalculated on refresh.
Fixes detection of inline tags such as span or strong when they are surrounded by comments.
Complex values containing a color are now handled as complex string values rather than color values.
Fixes spring easing being ignored when defined in the
defaultsparameter.Fixes
.call()and.sync()incorrectly inheritingdelayfromdefaultsparameters.Fixes cases where animations were not properly removed from
document.timeline.Fixes the first word of the second line being incorrectly added to the first line.
Fixes unnecessary empty spaces not being properly removed from lines.
Fixes spring parameters not properly setting the duration in Draggable.
Child loop and direction parameters are included in timeline duration, allowing seeking through iterations.
animejs 330 changes
Breaking changes 9
Adds the change callback, replacing run().
Cubic Bézier curves are now defined using a cubicBezier(x1,y1,x2,y2) string instead of an array.
Adds get() as the replacement for getValue().
getValue() is replaced by get().
Animations are now paused when the browser tab or window is not active.
The Timeline offset property is replaced by timelineOffset.
The run() callback is replaced by change().
The SVG scale property is no longer overridden by CSS transform scale.
Replaces the Timeline offset property.
New APIs and options 12
Timeline offset can now be set as a second argument inside .add().
Adds the changeBegin callback.
Adds the changeComplete callback.
Adds the endDelay parameter, which can also delay reversed animations.
Adds a new keyframes system for defining animations.
Adds the loopBegin callback.
Adds the loopComplete callback.
Adds responsive motion path animation.
Adds a helper to apply values instantly to multiple targets.
Adds the spring easing, with mass, stiffness, damping and velocity parameters.
Adds a helper for staggering animations.
Adds the steps easing.
Behavior and default changes 3
Adds automatic conversion of CSS units.
remove() can now remove targets from a timeline.
A transform property no longer needs to be re-defined when animating multiple transforms on the same target in a timeline.
Tooling 1
Adds ES6 Modules and a new build process.
Fixes and other changes 5
Fixes selection of specific HTML id selectors that are HEX colours.
Improves inline style unit handling by checking inline style before getComputedStyle.
Improves simultaneous animations on the same target.
Fixes wrong initial SVG transform values in some cases.
Fixes an error when no timeline parameters object is specified.