Skip to content

Install three-flatland in your project.

create-three-flatland generates a Vite starter with a running WebGPU sprite scene, linting, unit and Playwright tests, and agent guidance files.

Terminal window
npm create three-flatland@latest

The CLI prompts for the target directory and template. Available templates are three (plain Three.js) and react (React Three Fiber). For non-interactive use:

Terminal window
pnpm create three-flatland my-app --template react
pnpm create three-flatland --help

-t, --template <name> selects a template. --overwrite deletes every existing file and directory in the target except .git before scaffolding. Back up existing work before using this option.

Terminal window
npm install three-flatland three

React is not required. If you’re using React Three Fiber, add the additional dependencies:

Terminal window
npm install three-flatland three @react-three/fiber@10.0.0-alpha.3 react@~19.2.0 react-dom@~19.2.0
  • Three.js: ^0.185.1 (required for TSL/WebGPU support)
  • React: ~19.2.0 (for three-flatland/react; R3F alpha.3 requires React < 19.3)
  • @react-three/fiber: 10.0.0-alpha.3 (for three-flatland/react)
  • Node.js: >= 22 (LTS)

three-flatland ships its own type definitions. Three.js uses separate declarations; add them to an existing TypeScript project:

Terminal window
pnpm add -D @types/three@^0.185.4

React TypeScript projects also need their usual @types/react and @types/react-dom development dependencies. The generated starters already include the declarations required by their template.

See the LLMs page for more prompts and machine-readable documentation.