Micro-interactions
Shadow Cursor
A custom cursor with a shadow at its heel — a precise dot leads while a lagging blade trails on a spring, and when it crosses an interactive element the trail pools and swells around it, inverting whatever lies beneath. Scoped entirely to its own stage; the page cursor is never touched.
Install
bun add motionProps
| Prop | Type | Default | Description |
|---|---|---|---|
| dotSize | number | 8 | Size of the leading precise dot. |
| trailSize | number | 36 | Size of the lagging trailing ring. |
| stiffness | number | 150 | Spring stiffness of the trailing ring — higher lags less. |
| damping | number | 15 | Spring damping of the trailing ring. |
| cursorColor | string (hex) | "#a855f7" | Color of the dot and trailing ring. |
| blendMode | "difference" | "screen" | "exclusion" | "normal" | "difference" | Mix-blend-mode of the cursor over content beneath it. |
| poolScale | number | 2 | How much the trail swells when over an interactive element. |
What It Demonstrates
- Spring
- Motion driven by physics (tension, mass, damping) rather than a set duration.
- Follow-through
- Parts of an element keep moving and settle slightly after the main motion stops, adding weight.
- Hover effect
- Visual change when the cursor moves over an element.
- Momentum
- Motion that carries velocity, especially after a drag or interruption.
Related Components
Magnetic Button
A button that leans into your cursor — caught in a magnetic field it slides toward the pointer while an amethyst aura swells with proximity, then snaps home on a spring and answers every click with a dark ripple bursting outward from the point of contact.
Hover List
A display-type list where a shared accent block springs between rows on hover while the text indents and inverts.
Dial
A machined rotary knob: angular drag with detents you can feel on the way past, inertia on a flick, and a spring that settles into the nearest stop. The angle lives in a motion value rather than in React state — a drag writes it sixty times a second and a spring more often than that — so the only thing React holds is the detent index, and only when that integer actually changes. Arrow keys step through the same spring the hand does, so the keyboard is not a second, worse path to the same control.
Pixel Transition
Reveal a second layer through a random pixelated dissolve on hover.
Border Glow
A cursor-proximity gradient border with an outer glow.
Spotlight Shell
A card shell with 3D magnetic tilt, radial glow, and a shimmer sweep.