Skip to content

Magnetic dock

Sweep the pointer along the dock. Click an icon to open it.

Motion

Loading the lab

How it works

  • React
  • Motion
  • SVG
  • TypeScript

Each icon reads the pointer's distance along the dock and scales on a cosine falloff, so neighbours grow together instead of one at a time. A second, weaker field pulls icons toward the pointer and tilts them, which is the magnetic part.

Every value goes through its own spring, so the dock settles with a little overshoot when the pointer leaves. The controls change the springs live, and the icons are drawn in SVG so they stay sharp at any size.