# React Three Fiber

> React renderer for three.js: build 3D scenes as JSX components with hooks.

Source: https://tastebase.ehsanulsiam.workers.dev/browse/r3f

free

React renderer for three.js: build 3D scenes as JSX components with hooks.

by Poimandres[GitHub](https://github.com/pmndrs/react-three-fiber)[npm](https://npmjs.com/package/@react-three/fiber)

[visit](https://r3f.docs.pmnd.rs/?utm_source=tastebase&utm_medium=referral&utm_content=detail-page)

[https://r3f.docs.pmnd.rs](https://r3f.docs.pmnd.rs/?utm_source=tastebase&utm_medium=referral&utm_content=detail-preview)

## Try these

no preview

### [three.js](https://tastebase.ehsanulsiam.workers.dev/browse/three)

The standard WebGL and WebGPU 3D engine: scenes, cameras, materials, loaders.

no preview

### [Spline (react-spline)](https://tastebase.ehsanulsiam.workers.dev/browse/spline)

Embed 3D scenes designed in the Spline editor as a React component.

no preview

### [drei](https://tastebase.ehsanulsiam.workers.dev/browse/drei)

Ready-made helpers for React Three Fiber: controls, loaders, environments, text, shaders.

no preview

### [Motion](https://tastebase.ehsanulsiam.workers.dev/browse/motion)

The default animation library for React (formerly Framer Motion): springs, gestures, layout and exit animations.

## Looks that pick it

[Minimalfirst pick](https://tastebase.ehsanulsiam.workers.dev/looks/minimal)[Neon / cyberfirst pick](https://tastebase.ehsanulsiam.workers.dev/looks/neon)[Spatial (visionOS)first pick](https://tastebase.ehsanulsiam.workers.dev/looks/spatial)[Aurorafirst pick](https://tastebase.ehsanulsiam.workers.dev/looks/aurora)[Holographicfirst pick](https://tastebase.ehsanulsiam.workers.dev/looks/holographic)[Liquid chromefirst pick](https://tastebase.ehsanulsiam.workers.dev/looks/chrome)[Cyberpunkfirst pick](https://tastebase.ehsanulsiam.workers.dev/looks/cyberpunk)[Synthwavefirst pick](https://tastebase.ehsanulsiam.workers.dev/looks/synthwave)[AI glowfirst pick](https://tastebase.ehsanulsiam.workers.dev/looks/ai-glow)[Sci-fi HUDfirst pick](https://tastebase.ehsanulsiam.workers.dev/looks/sci-fi-hud)[Bento gridfirst pick](https://tastebase.ehsanulsiam.workers.dev/looks/bento-grid)[Flat designfirst pick](https://tastebase.ehsanulsiam.workers.dev/looks/flat-design)[and 9 more](https://tastebase.ehsanulsiam.workers.dev/looks)

## For your agent

##### Install

`npm i three @react-three/fiber && npm i -D @types/three`

##### Use it for

- interactive 3D hero objects in a React or Next.js landing page
- product configurators where React state drives materials and parts
- scroll-driven 3D storytelling sections

##### Skip it when

- a decorative gradient or noise background: use paper-shaders, no 3D stack needed
- a designer owns the scene and you only embed it: use spline
- non-React stacks: use three directly (or TresJS for Vue)

##### What's inside20 free

- Canvas
- three.js JSX elements (mesh, geometries, materials, lights)
- attach
- Events (onClick, onPointerOver...)
- useThree
- useFrame
- useLoader
- useGraph
- extend
- createPortal
- createRoot
- invalidate
- advance
- addEffect / addAfterEffect / addTail
- applyProps
- useInstanceHandle
- WebGPU renderer
- On-demand rendering
- Instancing
- React Native

##### Facts

**Frameworks**
react, react-native

**Styling**
unstyled

**Weight**
large

**Accessibility**
weak

**Maturity**
established

**License**
MIT

**Price**
Free

##### Pairs with

[drei](https://tastebase.ehsanulsiam.workers.dev/browse/drei)[three.js](https://tastebase.ehsanulsiam.workers.dev/browse/three)[Motion](https://tastebase.ehsanulsiam.workers.dev/browse/motion)[GSAP](https://tastebase.ehsanulsiam.workers.dev/browse/gsap)[Lenis](https://tastebase.ehsanulsiam.workers.dev/browse/lenis)

##### Alternatives

[three.js](https://tastebase.ehsanulsiam.workers.dev/browse/three)[Spline (react-spline)](https://tastebase.ehsanulsiam.workers.dev/browse/spline)

[Compare React Three Fiber with its alternatives](https://tastebase.ehsanulsiam.workers.dev/alternatives/r3f-alternatives)

```
import { Canvas, useFrame } from '@react-three/fiber'
import { useRef } from 'react'
import type { Mesh } from 'three'

function Knot() {
  const ref = useRef<Mesh>(null!)
  useFrame((_, dt) => { ref.current.rotation.y += dt * 0.3 })
  return (
    <mesh ref={ref}>
      <torusKnotGeometry args={[0.6, 0.2, 128, 16]} />
      <meshStandardMaterial color="#e5e5e5" roughness={0.3} />
    </mesh>
  )
}

<Canvas dpr={[1, 2]} camera={{ position: [0, 0, 3] }}>
  <ambientLight intensity={0.5} />
  <directionalLight position={[2, 2, 2]} />
  <Knot />
</Canvas>
```

https://r3f.docs.pmnd.rs/getting-started/examples

Loading website

[Visit](https://r3f.docs.pmnd.rs/?utm_source=tastebase&utm_medium=referral&utm_content=floating-pill)
