Letters are pulled toward the cursor with falloff — close letters attract strongly, distant letters barely tug. Springs return them to the line.
import MagnetText from '@crazygl/hero-magnet-text';
export default function Page() {
return (
<MagnetText
heading="magnetic"
strength={0.6}
radiusPx={260}
/>
);
}heading.strength (pull amount), radiusPx (influence radius).textColor, fontSize, headingFontFamily, headingFontWeight.transparentBackground, bgColor.npm install @crazygl/hero-magnet-textThe component takes the same props you see in the live customizer on the right — every default ships poster-quality.
import MagnetText from '@crazygl/hero-magnet-text';
export default function Landing() {
return (
<MagnetText />
);
}The wrapper renders static HTML on the server and only initialises the canvas after hydration, so search engines see your copy.
// app/page.tsx — works in SSR-first frameworks (Next, Remix, Astro, etc.)
'use client';
import MagnetText from '@crazygl/hero-magnet-text';
export default function Page() {
return (
<section>
<MagnetText
heading="Say hi."
subheading="Your new hero."
/>
<article>
<h2>Welcome</h2>
<p>Your content keeps its own voice below the hero.</p>
</article>
</section>
);
}