
React Three Fiber
Copy production-ready React Three Fiber patterns—models, scroll scenes, particles, physics, and perf tooling—for 3D marketing sites and product viewers.
Overview
React Three Fiber is an agent skill for the Build phase that supplies production-oriented R3F JSX patterns for models, interaction, effects, physics, and performance tuning.
Install
npx skills add https://github.com/freshtechbro/claudedesignskills --skill react-three-fiberWhat is this skill?
- 10 documented sections from GLTF loading through performance monitoring
- GLTF loader with Suspense fallback, `useGLTF.preload`, and animated `useAnimations` rigs
- Interactive product viewer, scroll-driven scenes, particles, 3D text, and post-processing stacks
- Physics, camera choreography, LOD, and performance monitoring patterns for shipping real pages
- 10 real-world R3F component pattern sections in the table of contents
- Covers GLTF loading through performance monitoring in one skill doc
Adoption & trust: 897 installs on skills.sh; 227 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need credible 3D in a React app but lack vetted Suspense, drei, and animation patterns to ship quickly.
Who is it for?
Indie front-end builders shipping WebGL marketing sites, 3D product configurators, or interactive demos on React 18+.
Skip if: Native mobile 3D, backend-only APIs, or teams that want a full game engine toolchain instead of R3F component snippets.
When should I use this skill?
Building or refactoring React Three Fiber scenes needing GLTF, animation, scroll, particles, physics, or perf monitoring patterns.
What do I get? / Deliverables
You assemble Canvas scenes from documented sections—loaders, viewers, scroll FX, and monitoring—ready to drop into your frontend codebase.
- Composable R3F components (loaders, viewers, effects, LOD, perf overlays)
- Scene scaffolding patterns with Suspense fallbacks and preload calls
Recommended Skills
Journey fit
How it compares
Frontend 3D pattern library—not a Qdrant migration workflow or shell CI checker.
Common Questions / FAQ
Who is react-three-fiber for?
Solo builders and small front-end teams using React who want agent-guided React Three Fiber examples instead of piecing together scattered tutorials.
When should I use react-three-fiber?
During Build → frontend when implementing GLTF heroes, scroll narratives, particle backgrounds, or perf-instrumented Canvas scenes before Ship.
Is react-three-fiber safe to install?
Treat it as documentation and code templates; review the Security Audits panel on this page and vet any suggested dependencies (`@react-three/fiber`, `@react-three/drei`) in your lockfile.
SKILL.md
READMESKILL.md - React Three Fiber
# React Three Fiber - Real-World Component Examples A comprehensive collection of production-ready R3F component patterns and examples. ## Table of Contents 1. [GLTF Model Loading](#1-gltf-model-loading) 2. [Interactive Product Viewer](#2-interactive-product-viewer) 3. [Scroll-Based Animations](#3-scroll-based-animations) 4. [Particle System](#4-particle-system) 5. [Text 3D](#5-text-3d) 6. [Post-Processing Effects](#6-post-processing-effects) 7. [Physics Simulation](#7-physics-simulation) 8. [Camera Animations](#8-camera-animations) 9. [LOD (Level of Detail)](#9-lod-level-of-detail) 10. [Performance Monitoring](#10-performance-monitoring) --- ## 1. GLTF Model Loading ### Basic Model Loader ```jsx import { useGLTF } from '@react-three/drei' import { Suspense } from 'react' function Model({ url, ...props }) { const { scene } = useGLTF(url) return <primitive object={scene} {...props} /> } // Preload for faster initial load useGLTF.preload('/models/scene.glb') export default function Scene() { return ( <Suspense fallback={<Loader />}> <Model url="/models/scene.glb" position={[0, 0, 0]} scale={0.5} /> </Suspense> ) } function Loader() { return ( <mesh> <boxGeometry args={[1, 1, 1]} /> <meshBasicMaterial wireframe color="white" /> </mesh> ) } ``` ### Model with Animations ```jsx import { useGLTF, useAnimations } from '@react-three/drei' import { useEffect, useRef } from 'react' function AnimatedModel({ url }) { const group = useRef() const { scene, animations } = useGLTF(url) const { actions, names } = useAnimations(animations, group) useEffect(() => { // Play first animation actions[names[0]]?.play() }, [actions, names]) return <primitive ref={group} object={scene} /> } useGLTF.preload('/models/animated.glb') ``` ### Model with Material Override ```jsx import { useGLTF } from '@react-three/drei' import { useEffect } from 'react' import * as THREE from 'three' function ModelWithCustomMaterial({ url }) { const { scene } = useGLTF(url) useEffect(() => { const customMaterial = new THREE.MeshStandardMaterial({ color: '#ff6b6b', metalness: 0.8, roughness: 0.2, }) scene.traverse((child) => { if (child.isMesh) { child.material = customMaterial child.castShadow = true child.receiveShadow = true } }) }, [scene]) return <primitive object={scene} /> } ``` --- ## 2. Interactive Product Viewer ```jsx import { useRef, useState } from 'react' import { Canvas, useFrame } from '@react-three/fiber' import { OrbitControls, Environment, useGLTF, Center, Bounds } from '@react-three/drei' import { useControls } from 'leva' function Product({ url }) { const { scene } = useGLTF(url) const meshRef = useRef() const [hovered, setHovered] = useState(false) // Material controls const { metalness, roughness, color } = useControls({ metalness: { value: 0.9, min: 0, max: 1, step: 0.01 }, roughness: { value: 0.1, min: 0, max: 1, step: 0.01 }, color: '#ffffff', }) useFrame((state) => { if (hovered) { meshRef.current.rotation.y += 0.01 } }) return ( <Center> <primitive ref={meshRef} object={scene} onPointerOver={() => setHovered(true)} onPointerOut={() => setHovered(false)} onClick={(e) => { e.stopPropagation() console.log('Product clicked:', e.object.name) }} /> </Center> ) } export default function ProductViewer() { return ( <Canvas camera={{ position: [0, 0, 5], fov: 45 }}> <color attach="background" args={['#f0f0f0']} /> <ambientLight intensity={0.5} /> <directionalLight position={[5, 5, 5]} intensity={1} /> <Suspense fallback={null}> <Bounds fit clip observe margin={1.2}> <Product url="/models/product.glb" /> </Bounds> <Environment preset="studio" /> </Suspense> <OrbitControls