R3f Interaction
React Three Fiber input handling covering pointer picking, drag ownership, camera controls, and keyboard movement.
- CCM score
- 68 of 100
- skills.sh installs
- 3.6K
- GitHub stars
- 138
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers pointer events, hit testing, bubbling, pointer capture, and camera or object drag ownership for 3D scenes
- Includes guidance on
stopPropagation,event.pointworld-space conversion,setPointerCapture, andKeyboardControlsfor movement - Enforces restoring camera controls after drags and clearing held input on focus loss, with keyboard alternatives for important actions
- Designed for React Three Fiber 9 and React 19 projects with Drei controls, not for animation or physics simulation itself
Install
$ npx -y skills add enzed/r3f-skills --skill r3f-interaction -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
React Three Fiber interaction
Check installed Fiber, Drei, and input-library versions first. Examples target Fiber 9 / React 19. Choose camera movement, object movement, and UI input owners before connecting handlers.
Selectable object
Mount beneath Canvas. Keep accessible DOM controls outside Canvas for important actions; mesh pointer handlers alone do not provide keyboard access.
import { useState } from 'react'
import { OrbitControls } from '@react-three/drei'
export default function Example() {
const [selected, setSelected] = useState(false)
return (
<>
<mesh
name="selectable-box"
onClick={(event) => {
event.stopPropagation()
setSelected((value) => !value)
}}
>
<boxGeometry />
<meshStandardMaterial color={selected ? 'gold' : 'coral'} />
</mesh>
<OrbitControls makeDefault />
</>
)
}
Event semantics
Details
- Repository
- github.com/enzed/r3f-skills
- Categories
- 3D, CAD & Modeling, Frontend & UI Code
More from enzed/r3f-skills
All 11Similar to R3f Interaction
More 3D, CAD & Modelingthreejs-interactioncloudai-x/threejs-skills22.4K installsInteractive picking, camera controls, and drag handling for three.js that behaves the same under WebGL and WebGPU.
r3f-fundamentalsenzed/r3f-skills2.5K installsReact Three Fiber scene setup with Canvas, typed JSX, hooks, render-loop control, and resource ownership rules.
r3f-physicsenzed/r3f-skills2.1K installsReact Three Fiber physics with Rapier: rigid bodies, colliders, forces, sensors, joints, and character controllers.
spline-interactivefreshtechbro/claudedesignskills3.3K installsBrowser-based 3D design and animation tool for building interactive scenes without writing Three.js code.
web3d-integration-patternsfreshtechbro/claudedesignskills3.7K installsMeta-skill that combines Three.js, GSAP ScrollTrigger, React Three Fiber, Motion, and React Spring into one 3D architecture.
input-keyboard-mouse-touchphaserjs/phaser1.2K installsKeyboard, mouse, touch, and gamepad input for Phaser 4 Scenes via the this.input plugin.