Three.js
JavaScript 3D library for creating interactive 3D graphics in browsers.
3. Used by agents' projects
Dependency in 150 public GitHub projects set up for AI coding agents that we scanned (2.4%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
threejs.org/docs/llms.txtFrom the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What Three.js does
Three.js is a general-purpose browser 3D library that ships two renderers, a default WebGL one and a WebGPU one with its own node-based shading language, and it publishes explicit instructions for language models that write code against it.
Three.js popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How Three.js is used
- Three.js is a dependency in 150 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (3.1% of the 4,867 JavaScript/TypeScript ones), #1 of 63 in 3d and graphics.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 3,012; those are left out of every share on this page.
- The most used alternative in our scan is OGL (16 projects).
- Projects that use it most often also use Tailwind CSS (80.0%), React Three Fiber (47.3%), Framer Motion (44.0%).
- It is more common in projects set up for Roo Code (6.3%) than for GitHub Copilot (2.4%).
By coding agent
Often used with
Three.js in practice
Strengths
Both renderers ship in the main builds. The project's LLM guide says to reach for <code>WebGPURenderer</code> when you need TSL custom materials, compute shaders or node-based materials.
The docs describe <code>WebGLRenderer</code> as the mature option, with the widest browser support. They also say most examples and tutorials use it.
TSL builds materials from composable nodes instead of GLSL strings. The docs say the same TSL material works on both the WebGL and WebGPU backends.
The docs index lists addon exporters for glTF, OBJ, PLY, STL, USDZ, DRACO, EXR and KTX2. They also list a long set of loaders, including GLTFLoader, FBXLoader and DRACOLoader.
Watch out for
Many copy-paste examples load a fixed old build through a plain <code><script></code> tag. The docs mark that pattern as wrong and ask for import maps pointing at the latest version.
The WebGPU renderer comes from a different entry point, <code>three/webgpu</code>. It also needs an awaited <code>init()</code> call before use. WebGL code does not carry over line for line.
Releases are numbered (r187 is the latest listed). Each release links a migration guide section. The r187 notes remove code that was deprecated back in r177, so upgrades can break older code.
Scene, camera and an animated cube
import * as THREE from 'three';
const width = window.innerWidth, height = window.innerHeight;
// init
const camera = new THREE.PerspectiveCamera( 70, width / height, 0.01, 10 );
camera.position.z = 1;
const scene = new THREE.Scene();
const geometry = new THREE.BoxGeometry( 0.2, 0.2, 0.2 );
const material = new THREE.MeshNormalMaterial();
const mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );
const renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setSize( width, height );
renderer.setAnimationLoop( animate );
document.body.appendChild( renderer.domElement );
// animation
function animate( time ) {
mesh.rotation.x = time / 2000;
mesh.rotation.y = time / 1000;
renderer.render( scene, camera );
}More about Three.js
Funding
- GitHub Sponsors: https://github.com/mrdoob
- GitHub Sponsors: https://github.com/HumanInteractive
- GitHub Sponsors: https://github.com/donmccurdy
- GitHub Sponsors: https://github.com/WestLangley
- 27 GitHub sponsors
Agent Skills for it
- three-best-practices: Three.js performance optimization and best practices guidelines. Use when writing, reviewing, or optimizing Three.js code. Triggers on tasks
Packages around it
- tailwindcss: Utility-first CSS
- @react-three: React bindings for Three.js
- clsx: Class name helper
- framer-motion: UI animation
- react: UI library
- tailwind-merge: Tailwind class merging
Alternatives
Three.js This page
Lightweight WebGL library for 3D graphics rendering with minimal overhead.
Fast 2D WebGL renderer for interactive graphics, games and animations.
Get started
Install it.
npm install threeRules for your agent
## Three.js
- In plain HTML, load `three` through an import map pointing at the latest version. Do not use old CDN `<script>` tags such as `r128/three.min.js`.
- Map `three/addons/` as well. Import controls and loaders from it, for example `import { OrbitControls } from 'three/addons/controls/OrbitControls.js';`.
- Default to `WebGLRenderer`. Switch to `WebGPURenderer` only when you need TSL materials, compute shaders or node-based materials.
- For WebGPU, import from `three/webgpu` and `await renderer.init()` before rendering.
- With `WebGPURenderer`, write custom materials in TSL (`three/tsl`), not raw GLSL or `onBeforeCompile` hacks.
- Pair TSL with node materials such as `MeshStandardNodeMaterial` or `MeshPhysicalNodeMaterial`.
- Before upgrading across releases, check the Migration Guide. Recent releases remove code deprecated in earlier ones.
AgentGid articles about Three.js
Teardown: A Claude Code Skill That Builds 3D Machine Simulators
A viral X article shows teardown, a free Claude Code skill that builds a machine as a 3D simulator in one offline HTML page and records it to video. We checked the repository: MIT, three working examples, what setup really needs and which claims hold up.
3D From One Image, Mocap From Video, Films in Code: 7 GitHub Repos
A Spanish viral list of 7 open-source repos for 3D and code-made video, checked on GitHub: the star counts hold up, but one needs DeepSeek Harness, one needs paid API calls for new assets, and img2threejs builds objects in code, not scenes from photos.
Claude Code Skills for Video and Animation: 8 GitHub Repos
A Chinese list of 8 Claude Code skills for video and animation, checked on GitHub: all were created in October 2026, one is not a skill at all, one needs paid DaVinci Resolve Studio under a non-commercial licence, and two lean on paid voice or image services.