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)
Props & Attributes
| HTML Attribute | JS / React Prop | Type | Default | Description |
|---|---|---|---|---|
data-fx-strength | strength | number | 0.35 | Magnetic pull multiplier relative to pointer distance from element center. |
data-fx-respect-reduced-motion | respectReducedMotion | boolean | true | Disables motion when OS Reduce Motion is enabled. |