Every character of the headline is an individual physical object. The cursor projects an invisible magnetic field — letters lean toward it, push back, and lift away. Hover a word and its letters float upward like iron filings rising from a sheet of paper.
import MagneticLetterField from '@crazygl/hero-magnetic-letter-field';
export default function Hero() {
return (
<MagneticLetterField
heading={'Make every\nword magnetic.'}
repelOrAttract="repel"
ctaLabel="Try it yourself"
/>
);
}heading (newlines control wrapping), subheading, ctaLabel, onCTAClick.magneticStrength, magneticRadius, repelOrAttract, maxTiltDegrees.springStiffness (how fast letters settle home).wordFloatStrength (how high the hovered word lifts).textColor, accentColor (hovered word), headingFontWeight, headingFontFamily.bgColor, bgGradient (preset overlay), transparentBackground.npm install @crazygl/hero-magnetic-letter-fieldThe component takes the same props you see in the live customizer on the right — every default ships poster-quality.
import MagneticLetterField from '@crazygl/hero-magnetic-letter-field';
export default function Landing() {
return (
<MagneticLetterField />
);
}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 MagneticLetterField from '@crazygl/hero-magnetic-letter-field';
export default function Page() {
return (
<section>
<MagneticLetterField
heading="Say hi."
subheading="Your new hero."
/>
<article>
<h2>Welcome</h2>
<p>Your content keeps its own voice below the hero.</p>
</article>
</section>
);
}