/rndrealm:fluid-interactionsfrom rndrealm
Build gesture-driven web interfaces that feel native: drags, flicks, sheets, swipe-back, swipe actions, pull to refresh, scrubbers, card-to-detail morphs and app-switcher style gestures. Use when adding or fixing anything the user drags, flicks or swipes, when an animation needs to start from the finger's speed, when something should rubber band at an edge, or when a gesture feels stuck, jumpy or janky on touch.
Ships in rndrealm. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Interfaces where motion behaves like physical objects instead of playing back a timeline. That covers:
Always build these interactions with motion. Its springs start from a velocity, its motion values update without re-rendering, and it follows reduced motion, which is everything this skill relies on. Don't use GSAP, anime.js or CSS transitions for them; the code here and in the references assumes motion. (The one hand-written loop, coasting in a custom scroller, still writes to a motion value and hands off to a motion spring.)
Install it before writing any code if it isn't in package.json, using the project's package manager (check the lockfile):
npm install motion # package-lock.json
pnpm add motion # pnpm-lock.yaml
yarn add motion # yarn.lock
bun add motion # bun.lock / bun.lockb
motion/react (motion, animate, useMotionValue, useTransform, MotionConfig, useReducedMotion).framer-motion: that's motion under its old name. Use it as it is, importing from framer-motion; don't install both.Never fake a spring with a duration and an easing curve (elastic, back, cubic-bezier overshoot). They can't start from the finger's speed.
springFromResponse, not raw stiffness and damping. See springs.VelocityTracker (last 100ms only) and pass velocity into the animation. Without it, the element stops dead for a frame before setting off.stop() the animation and read the current value as the new origin. Never block input while something is animating. Decide state (open or closed, which page is current) from where an animation is heading, not from the value or onComplete: a spring looks done long before it finishes. See drag and momentum and decide from the target.project(velocity) gives where a flick would coast to; snap to the nearest target from that point, not from the release point. That is what lets a short, fast flick skip a detent.applyRubberBand(value, min, max, d). The further you pull, the less it moves.x, y, scale, opacity. Read layout (getBoundingClientRect, clientWidth) once at the start or end of a gesture, never every frame.pointerup, pointercancel and lostpointercapture. A gesture that misses its end leaves the UI stuck. See pointer events.Copy these into the project and adapt them. physics.ts has no dependencies; the hooks need React, and use-motion-preference.ts needs motion.
springFromResponse, noBounce, VelocityTracker, rubberBand, applyRubberBand, rubberBandInverse, project, DECELERATION, nearest, nearestPoint, clamp, FADE.onEnd.{ reduceMotion, spring }, where spring() drops the bounce when reduced motion is on.const x = useMotionValue(0);
const origin = useRef(0);
const drag = useDrag({
onStart: () => {
x.stop(); // catch it mid-flight
origin.current = x.get(); // continue from where it is on screen
},
onMove: (delta) => {
x.set(applyRubberBand(origin.current + delta.x, min, max, width));
},
onEnd: (velocity) => {
const landing = x.get() + project(velocity.x);
animate(x, nearest(landing, targets), {
...spring(SNAP),
velocity: velocity.x,
});
},
});
return (
<motion.div {...drag} style={{ x }} className="touch-none select-none" />
);
Read the reference for the pattern you are building:
| Building | Read |
|---|---|
| Any spring, picking response and damping | springs |
| Draggable or flickable element, snapping to corners or points, custom scroller with momentum and paging | drag and momentum |
| Horizontal swipe inside a vertical list, swipe actions, pull to refresh | direction lock |
| Bottom sheet with detents | sheets |
| Video or audio scrubber with fine scrubbing | scrubbing |
| Thumbnail that grows into a detail view and drags back down to close | morphing |
| Edge swipe to go back in a navigation stack | swipe back |
| One gesture with several outcomes or modes (home bar, fine scrubbing, stretching swipe actions) | gesture modes |
| Reduced motion | reduced motion |
| A gesture that freezes, gets stuck, or breaks taps on touch | pointer events |
| Thing | Value |
|---|---|
| Most UI springs | springFromResponse(0.35–0.45, 0.85–0.9) |
| Navigation, paging, anything that shouldn't overshoot | damping ratio 1 |
| Velocity window | last 100ms |
| Direction lock threshold | 10px |
| Lock ratio for a strict axis | the winning axis is 2× the other |
| Rubber band constant | c = 0.55, d = the container's size on that axis |
| Projection deceleration | 0.998 (normal), 0.99 (fast, stops sooner) |
| Edge-swipe zone | 24px from the edge |
| Reduced-motion fade | 200ms ease-out |
Two choices have their own guidance, so don't guess them: how much a spring should bounce (springs) and whether a scroller coasts normally, stops fast or pages (drag and momentum). When unsure, no bounce and normal deceleration.
touch-action).code/physics.ts (opens in a new tab)code/use-drag.ts (opens in a new tab)code/use-motion-preference.ts (opens in a new tab)references/direction-lock.md (opens in a new tab)references/drag-and-momentum.md (opens in a new tab)references/gesture-modes.md (opens in a new tab)references/morphing.md (opens in a new tab)references/pointer-events.md (opens in a new tab)references/reduced-motion.md (opens in a new tab)references/scrubbing.md (opens in a new tab)references/sheets.md (opens in a new tab)references/springs.md (opens in a new tab)references/swipe-back.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub h00mankind/workflow --plugin rndrealm