Skip to main content
skill CX Codex

r3f-interaction — Claude Code skill: what it does, how to install

Configures pointer events, object picking, dragging, and camera controls in React Three Fiber. Helps avoid input conflicts between 3D scene controls and interactive meshes.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add EnzeD/r3f-skills --skill r3f-interaction -a claude-code
Open on GitHub

What r3f-interaction does

The skill sets interaction rules for React Three Fiber 9 and React 19 projects. It covers raycasting semantics, distinguishing the hit mesh (event.object) from the handler owner (event.eventObject). It also highlights how stopPropagation() halts event delivery to farther hits and ancestors without preventing raycasts that have already run. Canvas deselection relies on onPointerMissed.

For scene movement, the guide coordinates Drei helpers such as OrbitControls, CameraControls, and TransformControls. Custom drag interactions need explicit pointer capture via setPointerCapture alongside temporary suspension of default camera controls. Storing raw pointer positions in refs avoids unnecessary React re-renders during high-frequency movement.

Mesh pointer handlers do not supply keyboard accessibility on their own, so critical actions must stay in external DOM controls. When reading continuous movement from Drei KeyboardControls, poll the getter inside useFrame, normalize diagonal vectors, and clear held keys whenever window focus drops.

What it helps with

  • prevent camera rotation conflicts when dragging meshes across the scene
  • deselect active objects cleanly through Canvas onPointerMissed
  • coordinate pointer capture between OrbitControls and custom transform gizmos
  • implement continuous character movement using KeyboardControls in useFrame

Example prompts for the agent

  • Set up mesh selection in Canvas with stopPropagation and background deselection
  • Implement 3D object dragging while temporarily disabling OrbitControls
  • Add keyboard controls with normalized diagonal movement inside useFrame

How to install r3f-interaction

1Skills CLI (Vercel)

npx skills add EnzeD/r3f-skills --skill r3f-interaction -a claude-code

2Manually: put the files in place

~/.claude/skills/r3f-interaction/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/r3f-interaction/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about r3f-interaction

How to install r3f-interaction in Claude Code?

Run npx skills add EnzeD/r3f-skills --skill r3f-interaction -a claude-code.

What does the r3f-interaction skill do?

It equips the agent with guidelines and patterns for pointer events, 3D object dragging, keyboard navigation, and camera controls in React Three Fiber.

How does stopPropagation() affect pointerout in R3F?

Calling stopPropagation() blocks event delivery to farther hit objects along the raycast path. This can immediately fire pointerout on previously hovered meshes behind the clicked object.

Similar skills

Everything for Frontend and UI →

From the same set3

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor