Thousands of particles stream along smooth, divergence-free flow lines — a live visualisation of an invisible magnetic field. The pointer drops a new magnetic pole into the field; lines visibly bend, swirl, and repel around the cursor.
import MagneticFieldLines from '@crazygl/hero-magnetic-field-lines';
export default function Hero() {
return (
<MagneticFieldLines
heading="Invisible forces."
poleMode="swirl"
lineColor="#9fdcff"
/>
);
}heading + subheading, two columns, or a custom node.particleCount, fieldScale, flowSpeed, attractorCount, lineWidth, trailFade (tail length).lineColor, backgroundColor, lineOpacity.poleMode (swirl / attract / repel), poleStrength, poleRadius.transparent.npm install @crazygl/hero-magnetic-field-linesThe component takes the same props you see in the live customizer on the right — every default ships poster-quality.
import MagneticFieldLines from '@crazygl/hero-magnetic-field-lines';
export default function Landing() {
return (
<MagneticFieldLines />
);
}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 MagneticFieldLines from '@crazygl/hero-magnetic-field-lines';
export default function Page() {
return (
<section>
<MagneticFieldLines
heading="Say hi."
subheading="Your new hero."
/>
<article>
<h2>Welcome</h2>
<p>Your content keeps its own voice below the hero.</p>
</article>
</section>
);
}