Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Magnetic

A button that leans toward the pointer.

Move the pointer near the button.

Installation

pnpm add @heyramzi/ui

Usage

import { magnetic } from "@heyramzi/ui/effects/magnetic";
<button use:magnetic={{ intensity: 0.5, range: 130 }}>Book a call</button>

Keyboard and accessibility

  • The pull follows the pointer only. Keyboard focus doesn't move the element.
  • With reduced motion on, there's no pull at all.