New advertisers: 50% off your first month with code FIRSTMONTHSee slots
enzed avatar

R3f Animation

Frame-driven React Three Fiber animation covering damping, GLTF clips, timing, and on-demand rendering.

skills.sh installs
2.3K
GitHub stars
138
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers procedural motion with useFrame and refs, plus authored GLTF clip playback through Drei useAnimations
  • Includes a damping example that returns to idle, with guidance on clip cleanup and independent animated instances
  • Enforces delta-based timing with MathUtils.damp, and warns against fixed lerp fractions that overshoot at other frame rates
  • Designed for React 19 projects using Fiber 9 that animate meshes, use demand rendering, or hand collision-driven motion to Rapier

Install

$ npx -y skills add enzed/r3f-skills --skill r3f-animation -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

React Three Fiber animation

Check installed Fiber, Drei, and React versions first. These examples target Fiber 9 / React 19. Keep the project's animation library when it already meets the task.

Choose an owner

  • Use useFrame and refs for continuous transforms/uniforms; React state describes discrete goals such as selected, open, or active.
  • Use Drei useAnimations for authored GLTF clips. Read clip playback for independent animated instances and cleanup.
  • Use the project's spring/tween library for coordinated transitions; check its React peer dependencies before adding it. Do not introduce a state manager merely to animate a mesh.
  • Let Rapier own simulated body transforms. Animate kinematic targets through physics APIs rather than fighting the simulation with mesh positions.

Damping that can return to idle

Mount below Canvas; this also works with frameloop="demand". Click the box to change its target.

import { useEffect, useRef, useState } from 'react'
import { useFrame, useThree } from '@react-three/fiber'
import { MathUtils, type Mesh } from 'three'

Details

Repository
github.com/enzed/r3f-skills
Categories
Animation & Motion, Frontend & UI Code, Game Development
First seen
May 16, 2026

More from enzed/r3f-skills

All 11

Similar to R3f Animation

More Animation & Motion