CrazyGLCrazyGLHomeExploreGitHubBrowse heroesLoading hero…← Back to gallery@crazygl/magnet-text

Magnet Text

Letters are pulled toward the cursor with falloff — close letters attract strongly, distant letters barely tug. Springs return them to the line.

ReactInteractiveFont#magnet#cursor#typography

Usage

import MagnetText from '@crazygl/hero-magnet-text';

export default function Page() {
  return (
    <MagnetText
      heading="magnetic"
      strength={0.6}
      radiusPx={260}
    />
  );
}

Customise

  • Contentheading.
  • Magnetstrength (pull amount), radiusPx (influence radius).
  • TypographytextColor, fontSize, headingFontFamily, headingFontWeight.
  • BackdroptransparentBackground, bgColor.

Best for

  • Playful, interactive brand and product headlines
  • Creative-studio and portfolio hero sections
  • Landing pages that reward cursor exploration
01 · Install the package

One command, zero config.

npm install @crazygl/hero-magnet-text
02 · Render the component

Import once, drop it in.

The component takes the same props you see in the live customizer on the right — every default ships poster-quality.

hero.tsx
import MagnetText from '@crazygl/hero-magnet-text';

export default function Landing() {
  return (
    <MagnetText />
  );
}
03 · Use it in a page

SSR-safe by default.

The wrapper renders static HTML on the server and only initialises the canvas after hydration, so search engines see your copy.

page.tsx
// 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>
  );
}
You might also like

Similar heroes

Proximity Text FX

Letters near the cursor scale up and brighten; letters further away dim and shrink — an inverse-distance attention effect.

Cursor Shadow Text

The heading casts a real drop shadow whose direction tracks the cursor — like a single fixed light moving across the room.

Mouse Wave Text

A wave travels along the heading following the cursor — each letter pops up as the wave passes, then settles back. Switch to auto mode for a hands-off demo.

Text Image Cursor

A list of items where hovering each row reveals a thumbnail that follows the cursor — case-study index pattern, magazine-grade.

Cursor Reveal Text

Two stacked paragraphs — a primary line shown in the surface colour, and a secret reveal line shown only inside a cursor-following spotlight that grows on hover.

Pro Text Type Effect

A pro-grade typewriter: cycles through multiple strings with variable per-character speed, fluid font sizing (clamp), per-line gradient fills, and a choice of cursor characters from block to slug to bar.
Live customizer

Magnet Text

Pull strength0.6Influence radius (px)260pxText colourFont size150pxFontWeight800Transparent backgroundBackground
CrazyGL · crazygl.comProgrammable hero sections for real websites.