# Two.js

> JavaScript API for two-dimensional web drawing

Worth exploring: Update a rectangle’s rotation in the drawing loop

Why it works: One API for several renderers lets you try the same drawing in different output contexts.

Watch out: Choose the renderer for your drawing needs and test the result in the browser.

- Category: Motion & animation (`motion`)
- Tags: `open-source`, `webgl`
- Official: https://github.com/jonobr1/two.js
- Wunderlust: https://wunderlust.xyz/r/two-js
- Image: https://wunderlust.xyz/media/two-js-poster.jpg
- Video preview: https://wunderlust.xyz/media/two-js.webm
- Added: 2026-12-04

## What it is

The same API draws with WebGL, Canvas 2D, or SVG renderers. The repository example creates a rectangle and updates its rotation.

## What it’s for

Developers can build an animated 2D drawing and select a renderer for their project.

## Benefits

- Shared API across renderers
- Shape updates

## Similar on Wunderlust

- [SVG.js](https://wunderlust.xyz/r/svg-js.md): JavaScript library for manipulating and animating SVG
- [Vanta.js](https://wunderlust.xyz/r/vanta-js.md): Animated WebGL backgrounds for websites in a few lines of code
- [Lottie for Web](https://wunderlust.xyz/r/lottie-web.md): Web player for animations exported from After Effects
- [WebGL Fluid Simulation](https://wunderlust.xyz/r/webgl-fluid-simulation.md): WebGL fluid simulation
- [Liquid Glass JS](https://wunderlust.xyz/r/liquid-glass-js.md): WebGL library for glass effects inspired by Apple's Liquid Glass
- [Theatre.js](https://wunderlust.xyz/r/theatre-js.md): Motion design library for the web
