gestures

Build drag, swipe, and sheet interactions that track the finger 1:1 and stay interruptible.

55.5k|3.2k|Updated Mar 16, 2026
Ready to run
npx skills add https://github.com/emilkowalski/skills --skill gestures-emilkowalski
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: gestures
Source: https://github.com/emilkowalski/skills/tree/main/skills/gestures
Command: npx skills add https://github.com/emilkowalski/skills --skill gestures-emilkowalski

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Gestures that feel laggy, disconnected from the finger, or jump on release create friction in mobile and touch interfaces. This Skill ensures touch interactions feel physical and responsive by separating the tracking phase (1:1 finger follow) from the release phase (physics-based finish). ## Core Features & Use Cases - Track Phase Rules: Direct transform manipulation bypassing springs, no React state per move event, rubber-banding at boundaries - Release Phase Rules: Velocity-seeded springs, distance and velocity dismissal thresholds, interruptible animations - Use Case: Building a bottom sheet drawer that follows your finger exactly while dragging, dismisses based on speed or distance, and can be caught and reversed mid-animation without jumps or delays ## Quick Start Implement a draggable element using a motion value with 1:1 transform tracking during the pointer-down phase and a velocity-aware spring on release, ensuring the overlay opacity derives from drag progress.

Frequently Asked Questions about gestures

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a gesture that follows the finger 1:1 without lag?▼

Use a motion value to drive transform directly on the dragged element, never through a spring or CSS variable. Write transform values synchronously on pointermove to bypass the React render cycle, keeping position perfectly synchronized with the pointer.

Why does my dragged element trail behind the finger?▼

Trailing occurs when a spring applies during the tracking phase, making the element move through resistance. Remove all springs during pointer-down; apply springs only in the release phase after the pointer lifts.

How do I make a gesture dismissible by both distance and velocity?▼

In onDragEnd, check both info.offset against a threshold (typically 40–50% of travel distance) and info.velocity against a speed threshold (e.g., 500px/s). Dismiss if either condition passes, allowing both slow drags and fast flicks.

Can the user interrupt a gesture mid-animation and drag it back?▼

Yes, if you use springs with CSS transitions or motion values. Springs automatically retarget and preserve velocity on interruption. Keyframe animations restart from zero and cannot be caught—never use @keyframes on draggable elements.

What is rubber-banding and when should I use it?▼

Rubber-banding applies resistance when dragging past a boundary, moving the element only a fraction of the pointer distance (Motion: dragElastic ≈ 0.2). This communicates a limit physically rather than stopping hard, which feels more natural on touch.

Why should overlay opacity derive from drag progress, not animate separately?▼

Deriving opacity from a motion value tied to the dragged element's position ensures the overlay stays synchronized during tracking and interruption. Separate animations drift apart when the gesture reverses, breaking the unified interaction feel.