一键导入
react-three-drei
Helpers, abstractions, and ready-to-use components for React Three Fiber.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Helpers, abstractions, and ready-to-use components for React Three Fiber.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Plan, reason, and verify across multiple levels using multi-step reasoning, tree-of-thought, and structured agent workflows.
Detect and repair security vulnerabilities or operational errors in the agent's own code and environment without manual intervention.
Generate and apply complete design systems from text descriptions or visual examples using AI and modern tooling.
Adapt user interfaces automatically based on device, viewport, user preferences, and contextual signals.
Build and query knowledge graphs automatically to capture relationships between entities, concepts, and project artifacts.
Run agent tasks in isolated, sandboxed environments to prevent malicious or untrusted code from affecting the host system.
| name | react-three-drei |
| description | Helpers, abstractions, and ready-to-use components for React Three Fiber. |
Category: Frontend Engineering Priority: High
Helpers, abstractions, and ready-to-use components for React Three Fiber.nn
Reduce the time and complexity of building 3D React applications by using the correct drei component for cameras, controls, loading, gizmos, shapes, shaders, and staging. Prevent common mistakes like bundle bloat, SSR breakage, and memory leaks.
Use this skill when:
@react-three/fiber installed.@react-three/drei installed via npm install @react-three/drei.@react-three/drei/native).@react-three/fiber and @react-three/drei to the project.<Canvas> from @react-three/fiber.PerspectiveCamera, OrthographicCamera, or CubeCamera from drei instead of raw Three.js cameras.OrbitControls, ScrollControls, PresentationControls, or CameraControls based on interaction needs.useGLTF, useTexture, useVideoTexture, or Environment for models, textures, and lighting.instancedMesh, lazy-load heavy assets, and cap pixel ratio on mobile.import { Canvas } from '@react-three/fiber'
import { PerspectiveCamera, OrbitControls } from '@react-three/drei'
export default function Scene() {
return (
<Canvas>
<PerspectiveCamera makeDefault position={[0, 0, 5]} />
<OrbitControls />
<ambientLight intensity={0.5} />
<mesh>
<boxGeometry />
<meshStandardMaterial color="orange" />
</mesh>
</Canvas>
)
}
import { useGLTF } from '@react-three/drei'
function Model({ url }) {
const { scene } = useGLTF(url)
return <primitive object={scene} />
}
useGLTF.preload('/model.glb')
// Do not do this. It breaks tree-shaking and inflates the bundle.
import * as Drei from '@react-three/drei'
Html, Loader) in a React Native project.makeDefault on PerspectiveCamera so the camera is ignored.OrbitControls without limiting target or damping, causing jerky UX.prefers-reduced-motion for animated 3D content.useGLTF.preload, useTexture.preload, etc.instancedMesh for many repeated objects.dpr={[1, 2]} on Canvas.Suspense.@react-three/fiber and @react-three/drei are installed.@react-three/drei docs: https://pmndrs.github.io/drei@react-three/fiber docs: https://docs.pmndrs.rs/react-three-fiberdata/readme.md — latest README from pmndrs/dreidata/docs/ — latest MDX documentation from pmndrs/dreiLICENSE — MIT license of pmndrs/drei