Cursor: Floating target
An example of creating a floating target with rotating text and hover effects using the Motion+ Cursor and usePointerPosition.
Introduction
The Floating Target example creates a rotating button that reacts to your cursor with a smooth spring animation. As well as creating a custom usePointerReaction hook, we'll use several Motion APIs:
- The
usePointerPositionhook from Motion+ for tracking cursor position. - The
useTransformanduseSpringhooks for smooth cursor following. - The
useAnimatehook for continuous rotation. - The
Cursorcomponent from Motion+ for custom cursor effects. - Motion variants for hover and press animations.
