A polished React Three Fiber starter kit for public, remixable WebGL projects.
This repo is intentionally small: it gives you a working R3F scene, a tuned camera workflow, strict TypeScript, Tailwind CSS, Leva controls, GLSL imports, linting, formatting, and a Vite build without locking you into an application architecture.
- React 19, Vite, TypeScript, and React Three Fiber
- Drei primitives and controls
- Leva camera controls with a copy-to-clipboard export helper
- Tailwind CSS 4 via the Vite plugin
- GLSL imports through
vite-plugin-glsl - Strict TypeScript and ESLint configuration
- Prettier formatting
pnpm install
pnpm devThe dev server runs on http://localhost:3000.
pnpm dev # start Vite
pnpm build # typecheck and build for production
pnpm preview # preview the production build
pnpm lint # run ESLint
pnpm typecheck # run TypeScript project references
pnpm format # format files with Prettier
pnpm format:check # verify Prettier formatting
pnpm clean # remove build and TypeScript cache outputThe camera rig lives in src/scene/CameraController.tsx, with persisted defaults in
src/scene/cameraSettings.ts.
- Run the app.
- Frame the scene with OrbitControls or the Leva camera panel.
- Click Copy camera settings in Leva.
- Replace
cameraSettingswith the copied output.
src/App.tsxowns the page shell,<Canvas>, and overlay UI.src/scene/Scene.tsxowns the starter Three.js scene.src/scene/CameraController.tsxowns camera controls and export behavior.src/scene/shared/threeUniforms.tsis a small typed helper for shader uniforms.
Three is pinned to 0.182.0 so the current React Three Fiber runtime starts with a clean dev
console. Revisit this pin when React Three Fiber replaces its internal THREE.Clock usage with
THREE.Timer.
MIT. See LICENSE.