← Atlas · Topics: 3d-and-shaders, components
Drei
- Type
- component library
- Verdict
- Very useful
- Licence
- Ship licence, open source permissive
open-source-permissivefree; MIT (repository pmndrs/drei) - Agent channels
- mcp, llms-txt
- Pricing
- free
- Reviewed
What it is
Drei is the helper library for React Three Fiber, maintained by the Poimandres (pmndrs) open-source collective. It wraps common three.js chores as ready-made components and hooks: cameras, orbit and scroll controls, model and texture loaders, text, environment lighting, soft shadows, special materials, portals and performance tools. At review, its docs listed 133 helpers in 12 groups, the largest being staging (25), abstractions (21), misc (21), loaders (13) and performance (12). The package @react-three/drei was on 10.7.9, needs React 19 and Fiber 9, had about 9,900 GitHub stars and was downloaded roughly 14 million times a month. A separate Storybook shows each helper running live.
When to open it
Open it as soon as you start an R3F scene. Most things a product page, configurator or portfolio needs (load a GLB, light it well, let people orbit it, add floating text) already exist here, so you spend time on the scene rather than on three.js plumbing.
Most useful
- Staging:
Environment,Stage,ContactShadows,AccumulativeShadows,Lightformer,FloatandSparklesgive a studio look in a few lines - Loaders:
useGLTF(with Draco and Meshopt support),useTexture,useKTX2,useVideoTextureanduseProgressfor loading screens - Controls:
CameraControls,PresentationControlsfor product spins,ScrollControlsfor scroll-driven scenes, plus pivot and transform gizmos - Materials: transmission, refraction, reflector, distort and wobble materials, and a
shaderMaterialhelper for your own GLSL - Performance:
Instances,Merged,Detailed(LOD),Bvh,AdaptiveDpr,PerformanceMonitorandBakeShadows - HTML in 3D:
Htmlpins DOM elements to objects;Viewrenders several scenes through one canvas
Using it with agents
The docs publish an llms.txt index and a roughly 200 kB llms-full.txt. They also point to a pmndrs docs MCP server at https://docs.pmnd.rs/api/mcp (HTTP). At review it answered and offered two tools, one that returns a docs page for Drei, R3F, Zustand and other pmndrs libraries and one that returns a full example with its source files. Have the agent look up each helper's props there instead of relying on memory, since Drei's API has shifted between major versions.
Watch out for
Environmentpresets fetch HDRIs from a public CDN, and the docs say they are not meant for production. Host your own.hdrfiles (for example from Poly Haven)useGLTFloads Draco decoders from Google's CDN by default. Pass a local decoder path if you need to work offline or keep third-party requests out- The
nativeentry point for React Native leaves outHtmlandLoader - Match major versions: Drei 10 goes with Fiber 9 and React 19, and older tutorials often show Drei 9 APIs
- Helpers are convenient but not free. Heavy materials such as transmission and real-time reflections cost a lot on mobile GPUs
Reusable ideas
- Package the setup code everyone rewrites (lighting, controls, loading) as small, composable components with sensible defaults
- Group a large helper set by job (staging, loaders, controls, performance) so people find what they need by intent
- Ship a Storybook next to the docs so every helper can be seen running before install
- Serve one MCP endpoint for a whole family of libraries, with example source as well as reference pages
Related
React Three Fiber, Three.js, Poly Haven, gltf.report, Canvas UI