Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A minimalist Next.js, React Three Fiber, and Three.js starter with persistent WebGL canvas and DOM-integrated 3D.
React Three Next is a free, open-source boilerplate for creating Next.js applications that combine normal 2D DOM content with 3D WebGL scenes rendered by React Three Fiber and Three.js. It is maintained by the pmndrs organization and installed via the create-r3f-app command-line tool. The starter keeps a single persistent WebGL canvas alive across page navigation, so 3D elements can appear anywhere on a page without being re-created on every route change.
React Three Next is a minimalist starter template that pairs the Next.js App Directory architecture with @react-three/fiber and Three.js. Its core function is to let developers embed Three.js scenes directly inside regular page sections, using a tunnel-rat-based portal system to render DOM components into the WebGL context. The template takes a standard Next.js project and produces a working site with a persistent canvas, GLSL shader import support, and optional TypeScript scaffolding.
View component render in the 3D context, letting 3D content be placed in any div of the page.gl.scissor to segment the viewport into smaller render areas.-ts or --typescript to the scaffold command generates a TypeScript project.View component, with interactions synchronized to the DOM.The template uses tunnel-rat to portal components between the DOM renderer and the WebGL renderer. Anything rendered inside the View component is tunneled into the 3D context, while the canvas employs gl.scissor to allocate exactly the needed viewport segments. This keeps the canvas mounted and synchronized with the DOM across route changes.
Run yarn create r3f-app next my-app or npx create-r3f-app next my-app. To scaffold a TypeScript version, append -ts or --typescript to the command.
Tailwind CSS is the default style. The CLI also supports a styled-components variant, so you can choose either when creating a project.
Yes, it is an open-source starter hosted on GitHub under the pmndrs organization and available through npm without cost.
The README reports a Lighthouse score of 100 in all four categories, first load JavaScript of roughly 79kb, and a TTL around 100ms.
Yes, the starter is based on the Next.js App directory architecture, so it uses the modern file-based routing and server components structure.
