react-three-fiber

Build declarative Three.js 3D scenes in React using JSX components and hooks.

Updated Aug 12, 2026
One-click install
npx skills add https://github.com/sixscripts-ai/agent-arena-voice --skill react-three-fiber-sixscripts-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-three-fiber
Source: https://github.com/sixscripts-ai/agent-arena-voice/tree/main/.claude/plugins/claudedesignskills/plugins/bundles/core-3d-animation/skills/react-three-fiber
Command: npx skills add https://github.com/sixscripts-ai/agent-arena-voice --skill react-three-fiber-sixscripts-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Writing Three.js imperatively inside React apps leads to verbose, hard-to-maintain code with manual lifecycle management. This Skill provides the patterns, APIs, and boilerplate generators to build 3D scenes declaratively with React Three Fiber, using components, hooks, and state management. ## Core Features & Use Cases - Declarative 3D Components: Create meshes, lights, cameras, and materials as JSX elements with prop-based configuration, animated via the useFrame hook. - Asset Loading & Drei Integration: Load GLTF models and textures with useLoader caching and Suspense, plus Drei helpers like OrbitControls, Environment, Text, and ScrollControls. - Code Generators: Use the bundled Python scripts to generate component boilerplate (animated, interactive, instanced, model loaders) and complete scene setups with presets for product viewers, games, and performance-optimized scenes. - Use Case: Build an interactive product configurator where users rotate a GLTF model, change materials via state, and see contact shadows and HDRI environment lighting. ## Quick Start Ask the AI to create a React Three Fiber scene with a rotating box, orbit controls, and environment lighting using this skill.

Frequently Asked Questions about react-three-fiber

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a 3D scene in React with Three.js?

Use React Three Fiber's Canvas component as the root, then declare meshes, geometries, materials, and lights as JSX children. Props like position, rotation, and args map directly to Three.js object properties and constructor arguments.

How to animate objects in React Three Fiber?

Use the useFrame hook with a ref to mutate object properties each frame, such as rotation or position. Never call setState inside useFrame, since it triggers React re-renders every frame and hurts performance.

How do I load GLTF models in React Three Fiber?

Use useLoader with GLTFLoader or Drei's useGLTF hook, wrapped in a Suspense boundary for async loading. Assets are cached automatically, and you can preload them with useGLTF.preload before components mount.

Does React Three Fiber work with Next.js and TypeScript?

Yes, R3F works with React frameworks including Next.js, Gatsby, and Remix, and provides full TypeScript support via ThreeElements types. The component generator script can emit TypeScript boilerplate with typed props interfaces.

Why is my React Three Fiber scene slow or re-rendering?

Common causes include calling setState inside useFrame, creating new Three.js objects in render instead of using arrays or useMemo, and subscribing to all state with useThree instead of selective selectors. Use instancing, frameloop="demand", and AdaptiveDpr for further optimization.

When should I use React Three Fiber instead of plain Three.js?

Choose R3F when building 3D inside React applications where you need hooks, state management, and reusable component abstractions. Plain Three.js fits better for non-React projects or when you need direct imperative control without a reconciler.