Skip to content
Kitbay
Skill

gestures

MITUpdated on Nov 9, 202655,996GitHub stars

A skill from Emil Kowalski's collection for building drag, swipe and sheet interactions on the web that follow the finger exactly and can be caught mid-motion.

What the skill teaches

A skill from Emil Kowalski's collection for building drag, swipe and sheet interactions on the web that follow the finger exactly and can be caught mid-motion. While the pointer is down the element tracks it one to one with no easing or React state updates, with rubber-band resistance past an edge; on release a spring seeded with the release velocity finishes the motion, and dismissal depends on distance or a fast flick. For bottom sheets and drawers it recommends the Vaul library over hand-rolled code. It also covers keeping overlays in sync with drag progress, dismissing in the entry direction, hold-to-confirm timing, touch targets, touch-action and reduced-motion fallbacks.

Capabilities

  • Make drags track the pointer one to one
  • Finish flings with velocity-seeded springs
  • Set dismiss thresholds by distance or speed
  • Add reduced-motion fallbacks to gestures