Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-three-fiber

> å‰ē«Æę”†ęž¶
Open source

šŸ‡ØšŸ‡­ A React renderer for Three.js

31.6K stars0 likes5 views
WebsiteGitHub

About

šŸ‡ØšŸ‡­ A React renderer for Three.js

@react-three/fiber

react-three-fiber is a React renderer for threejs.

Build your scene declaratively with re-usable, self-contained components that react to state, are readily interactive and can participate in React's ecosystem.

bash
npm install three @types/three @react-three/fiber

[!WARNING]
Three-fiber is a React renderer, it must pair with a major version of React, just like react-dom, react-native, etc. @react-three/fiber@8 pairs with react@18, @react-three/fiber@9 pairs with react@19.


Does it have limitations?

None. Everything that works in Threejs will work here without exception.

Is it slower than plain Threejs?

No. There is no overhead. Components render outside of React. It outperforms Threejs in scale due to React's scheduling abilities.

Can it keep up with frequent feature updates to Threejs?

Yes. It merely expresses Threejs in JSX, <mesh /> dynamically turns into new THREE.Mesh(). If a new Threejs version adds, removes or changes features, it will be available to you instantly without depending on updates to this library.

What does it look like?

Let's make a re-usable component that has its own state, reacts to user-input and participates in the render-loop. (live demo).
    </a>
  </td>
</tr>
…
Show TypeScript example
bash
npm install @types/three
…

Live demo: https://codesandbox.io/s/icy-tree-brnsm?file=/src/App.tsx

Show React Native example

This example relies on react 18 and uses expo-cli, but you can create a bare project with their template or with the react-native CLI.

bash
# Install expo-cli, this will create our app
npm install expo-cli -g
# Create app and cd into it
expo init my-app
cd my-app
# Install dependencies
npm install three @react-three/fiber@beta react@rc
# Start
expo start

Some configuration may be required to tell the Metro bundler about your assets if you use useLoader or Drei abstractions like useGLTF and useTexture:

javascript
// metro.config.js
module.exports = {
  resolver: {
    sourceExts: ['js', 'jsx', 'json', 'ts', 'tsx', 'cjs'],
    assetExts: ['glb', 'png', 'jpg'],
  },
}
…

Documentation, tutorials, examples

Visit docs.pmnd.rs

First steps

You need to be versed in both React and Threejs before rushing into this. If you are unsure about React consult the official React docs, especially the section about hooks. As for Threejs, make sure you at least glance over the following links:

  1. Make sure you have a basic grasp of Threejs. Keep that site open.
  2. When you know what a scene is, a camera, mesh, geometry, material, fork the demo above.
  3. Look up the JSX elements that you see (mesh, ambientLight, etc), all threejs exports are native to three-fiber.
  4. Try changing some values, scroll through our API to see what the various settings and hooks do.

Some helpful material:

  • Threejs-docs and examples
  • Discover Threejs, especially the Tips and Tricks chapter for best practices
  • Bruno Simons Threejs Journey, arguably the best learning resource, now includes a full R3F chapter

Ecosystem

There is a vibrant and extensive ecosystem around three-fiber, full of libraries, helpers and abstractions.

  • @react-three/drei – useful helpers, this is an ecosystem in itself
  • @react-three/gltfjsx – turns GLTFs into JSX components
  • @react-three/postprocessing – post-processing effects
  • @react-three/uikit – WebGL rendered UI components for three-fiber
  • @react-three/test-renderer – for unit tests in node
  • @react-three/offscreen – offscreen/worker canvas for react-three-fiber
  • @react-three/flex – flexbox for react-three-fiber
  • @react-three/xr – VR/AR controllers and events
  • @react-three/csg – constructive solid geometry
  • @react-three/rapier – 3D physics using Rapier
  • @react-three/cannon – 3D physics using Cannon
  • @react-three/p2 – 2D physics using P2
  • @react-three/a11y – real a11y for your scene
  • @react-three/gpu-pathtracer – realistic path tracing
  • create-r3f-app next – nextjs starter
  • lamina – layer based shader materials
  • zustand – flux based state management
  • jotai – atoms based state management
  • valtio – proxy based state management
  • react-spring – a spring-physics-based animation library
  • framer-motion-3d – framer motion, a popular animation library
  • use-gesture – mouse/touch gestures
  • leva – create GUI controls in seconds
  • maath – a kitchen sink for math helpers
  • miniplex – ECS (entity management system)
  • composer-suite – composing shaders, particles, effects and game mechanics
  • triplex – visual editor for react-three-fiber
  • koestlich – UI component library for react-three-fiber

Usage Trend of the @react-three Family

Who is using Three-fiber

A small selection of companies and projects relying on three-fiber.

  • vercel (design agency)
  • basement (design agency)
  • studio freight (design agency)
  • 14 islands (design agency)
  • ueno (design agency) — video
  • flux.ai (PCB builder)
  • colorful.app (modeller)
  • bezi (modeller)
  • readyplayer.me (avatar configurator)
  • zillow (real estate)
  • lumalabs.ai/genie (AI models)
  • skybox.blockadelabs (AI envmaps)
  • 3dconfig (floor planer)
  • buerli.io (CAD)
  • getencube (CAD)
  • glowbuzzer (CAD) — video
  • triplex (editor) — video
  • theatrejs (editor) — video

How to contribute

If you like this project, please consider helping out. All contributions are welcome as well as donations to Opencollective, or in crypto BTC: 36fuguTPxGCNnYZSRdgdh6Ea94brCAjMbH, ETH: 0x6E3f79Ea1d0dcedeb33D3fC6c34d2B1f156F2682.

Backers

Thank you to all our backers! šŸ™

Contributors

This project exists thanks to all the people who contribute.

IssuesĀ· 18 open

View all issuesOpen on GitHub
  • #3955

    [v10][tsl] Uniforms defined as importable objects, typed across files

    Typescriptv10Updated Sep 30, 2026
  • #3798

    repeatable browser/WebGPU validation harness

    v10betaUpdated Sep 30, 2026
  • #3797

    test coverage on stable surfaces before beta.1

    v10betaUpdated Sep 30, 2026
  • #3980

    [v9] Unmounting doesn't request a frame with frameloop="demand" (regression since v9)

    Updated Sep 28, 2026
  • #3965

    [v10] Multi-canvas: under the WebGL2 fallback, a secondary canvas draws into the primary's canvas

    v10Updated Sep 26, 2026
  • #3958

    DPR goes stale when devicePixelRatio changes (moving to another display, browser zoom)

    bugcorev10v9Updated Sep 26, 2026
  • #3956

    [v10][tsl] Generate the uniforms Register declaration with a Vite plugin

    Typescriptv10Updated Sep 25, 2026
  • #3954

    [v10] Port useGLTF into core as part of the asset pipeline

    v10Updated Sep 25, 2026
  • #3903

    Remove `onUpdate`

    corev10breaking-changeeventsUpdated Sep 25, 2026
  • #3926

    v10: R3F-created WebGPURenderer is not disposed on unmount

    Updated Sep 23, 2026

> Tags

TypeScript3danimationfiberreact

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
Categoryå‰ē«Æę”†ęž¶
PricingOpen source

> Related tools

R
React
ē”ØäŗŽęž„å»ŗē”Øęˆ·ē•Œé¢ēš„ JavaScript åŗ“
V
Vue.js
ęøčæ›å¼ JavaScript ꔆꞶ
N
Next.js
åŸŗäŗŽ React ēš„å…Øę ˆ Web ꔆꞶ