# Using Gestures in Motion

Essay by Jakub Krehel (https://jakub.kr)

Gestures are what make elements feel alive: the user acts, and the interface responds the way the physical world would.

Topics: Motion
Source: https://jakub.kr/work/motion-gestures

## For agents

Nothing to install. This is a reference: cite it, or fetch the source when
the reasoning matters.

Read it at: https://jakub.kr/work/motion-gestures

The full text is not reproduced here. It belongs to its author. What is
above is the author's own summary and the topics it covers.

Skills in this library that act on the same ground:

- emil-design-eng (https://www.stackskills.dev/md/emil-design-eng): The design-engineering house style behind Sonner and Vaul.
- animate (https://www.stackskills.dev/md/animate): Builds an animation from scratch, decisions in the order that matters.
- review-animations (https://www.stackskills.dev/md/review-animations): Reviews your motion strictly, against Emil's rules.
- improve-animations (https://www.stackskills.dev/md/improve-animations): Audits every animation in a codebase and hands back prioritised plans.
- find-animation-opportunities (https://www.stackskills.dev/md/find-animation-opportunities): Finds where motion would genuinely help, and says what not to animate.

## The short version

Motion extends React's event system with hover, tap, pan, drag, focus and inView, each available as a while- prop or as an event handler. Jakub goes through what every gesture is for and how to make the interface answer it properly. Tap cancels itself if the pointer travels too far, so it never fights a drag, and it works from the keyboard as well. The real reason he prefers Motion over plain CSS here is springs, which are difficult to express in CSS and often look more natural. Performance is close to identical, since transform, clipPath and filter still run on the compositor thread.

## Verification

- Source link: Resolved (HTTP 200) (pass)
- Reading copy: Plain markdown for agents at /md/using-gestures-in-motion (pass)
- Attribution: Credited to Jakub Krehel (pass)

Full page: https://www.stackskills.dev/library/using-gestures-in-motion
