Description
tween.js is a JavaScript and TypeScript tweening engine for easy animations. A tween smoothly changes the numeric properties of an object from one value to another over time, using easing functions, including the well-known equations by Robert Penner, which the project says have been optimised. The library does one job: it tweens the properties of an object. It does not add CSS units such as px for you, it does not interpolate colours, and it does not create its own animation loop, which makes it easy to plug into whatever loop your application already runs, such as requestAnimationFrame. Easing functions can be reused outside a tween, and you can supply custom easing functions. The README lists many examples, including chained tweens, repeat and yoyo, relative values, pausing, stopping chained tweens, interpolating arrays, and dynamic targets. Installation is through npm, and the library is also available from a CDN. The project is on GitHub and has a CodePen example to try in the browser.…
Highlights
- Tweens numeric properties of objects
- Built-in and custom easing functions
- No animation loop of its own
- Chained, repeating and yoyo tweens
Ratings & Reviews
No ratings yet
Be the first to rate Tween.js.
People also visit
Tween.js FAQ
What is tween.js?
A JavaScript and TypeScript library that smoothly animates the properties of an object over time.
Does it run its own animation loop?
No. The README says it can be integrated into any animation loop.
Does it handle CSS units or colours?
No. It does not append px for you and does not interpolate colours.
How do I install it?
With npm, or from a CDN, as described in the installation section.
Are there examples?
Yes. The README lists many examples, from a simple hello world to chained, relative and yoyo tweens.
What are the best Tween.js alternatives?
Popular alternatives to Tween.js include Unity Tweens, Shifty and Bezier Easing. See all Tween.js alternatives







