BASE

React Three Fiber + Drei

React Three Fiber + Drei

Library / tool · Free

A React renderer for Three.js and a collection of ready-made helpers. You can ask Codex to build an interactive 3D scene from components; Drei adds cameras, scroll controls, 3D text, lighting, and environment effects.

Resource illustration: React Three Fiber + Drei

Open resource ↗

What you can use for free

The open-source R3F and Drei libraries are free, with no mandatory account or subscription.

Access and limitations

The open-source R3F and Drei libraries are free, with no mandatory account or subscription. Models, textures, and other external materials have their own licenses.

Use cases

  • A 3D hero for a landing page
  • A rotatable product viewer
  • A scene that responds to scrolling
  • Portfolios and interactive graphics

Example workflow

A possible workflow; this is not a report of hands-on testing.

Connect an object's color to a React interface value.

Before you start

  • A React project with compatible dependencies.
  • Two colors and a simple mesh.

Steps

  1. Create a Canvas with a camera and an object.
  2. Pass the selected color from React state to the material.
  3. Check switching and reopening the scene.

Check your result

  • The material matches the selected color.
  • Scene behavior does not block interface controls.

Choosing React Three Fiber + Drei

Describe Three.js scenes with React components and use Drei helpers.

Choose this when

  • The 3D scene needs to respond to React application state.
  • You need to reuse parts of the scene as components.

Consider alternatives when

  • Ordinary Three.js is suitable if the project does not use React and does not need a declarative model.

Requirements

  • React, Three.js, and a Fiber version compatible with the chosen React version; add Drei as needed.

Things to consider

  • Knowing React does not replace an understanding of cameras, materials, and lighting.
  • GPU cost depends on scene content.

Frequently asked questions

Does Fiber replace Three.js?

No. It is a React renderer for Three.js; geometry and materials belong to Three.js, while Drei adds helpers.

Related tasks and approaches

  • Three.js

    Foundation: scenes, cameras, materials, and geometry.

  • React

    Foundation: components and connecting the scene to application state.

Tech stack

  • React
  • Three.js

License

MIT for R3F and Drei. Commercial use is permitted when the code license is retained; rights to third-party models/textures must be checked separately.

MIT — permissive license

You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.

License terms

Usage details

JavaScript/TypeScript, React, and Three.js. R3F 8 corresponds to React 18, and R3F 9 to React 19. Drei extends R3F with cameras, lighting, and other helpers; the browser requires GPU graphics. Test scene performance on the target devices.

Technologies and topics

  • Three.js
  • React Three Fiber
  • Drei
  • React
  • Codex

Sources

Other resources