GitHub
Translate

Opens Google Translate in a new tab. Website translation availability varies by region. Details

DOM Interaction • Zero WebGL Contexts

Magnetic

Gently pulls buttons, badges, and interactive CTAs toward the pointer using GPU-composited translate3d transforms, then springs cleanly back to rest at 0% CPU.

Live Playground

Strength 0.40

Where to Use It

Primary Hero CTA Buttons

Give primary signup or demo buttons subtle tactile attraction without interfering with keyboard focus or click accuracy.

Navigation Links & Floating Pills

Apply with low strength (0.18–0.30) to social icons, play buttons, or filter chips across toolbars.

Usage (Copy & Paste)

<button data-fx="magnetic" data-fx-strength="0.35">
  Explore FluxFX
</button>
<script src="https://unpkg.com/@votax572002/fluxfx/dist/fluxfx.min.js"></script>
'use client';
import { Magnetic } from '@votax572002/fluxfx/react';

export function CtaButton() {
  return (
    <Magnetic strength={0.35}>
      <button>Explore FluxFX</button>
    </Magnetic>
  );
}
import { FluxFX } from '@votax572002/fluxfx';

FluxFX.apply(btn, 'magnetic', {
  strength: 0.35,
  respectReducedMotion: true,
});

How It Works (Flowchart)

Center Offset (pointer - center) * strength Exponential Spring 1 - exp(-10 * dt) GPU Transform translate3d(x, y, 0) Snap & Sleep Restores orig transform

Props & Attributes

HTML AttributeJS / React PropTypeDefaultDescription
data-fx-strengthstrengthnumber0.35Magnetic pull multiplier relative to pointer distance from element center.
data-fx-respect-reduced-motionrespectReducedMotionbooleantrueDisables motion when OS Reduce Motion is enabled.