Heading cycles through a curated stack of Google Fonts on a timer — each crossfade preserves the line so the words stay readable while the personality changes. Per-font scale is auto-normalised so display, mono, and handwriting faces all read at the same visual size. Prefix and suffix stay in a fixed font when you only want part of the line to flip.
import FontChanger from '@crazygl/hero-font-changer';
export default function Hero() {
return (
<FontChanger
prefix="Type, in every"
heading="voice"
fontList={`Inter\nPlayfair Display\nMonoton\nLobster`}
holdDuration={140}
fadeDuration={90}
/>
);
}prefix (fixed font), heading (the cycling word), suffix (fixed font), fontList (one Google font per line).holdDuration (ms each font holds), fadeDuration (ms crossfade).textColor, fontSize, fontWeight.transparentBackground, bgColor.npm install @crazygl/hero-font-changerThe component takes the same props you see in the live customizer on the right — every default ships poster-quality.
import FontChanger from '@crazygl/hero-font-changer';
export default function Landing() {
return (
<FontChanger />
);
}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 FontChanger from '@crazygl/hero-font-changer';
export default function Page() {
return (
<section>
<FontChanger
heading="Say hi."
subheading="Your new hero."
/>
<article>
<h2>Welcome</h2>
<p>Your content keeps its own voice below the hero.</p>
</article>
</section>
);
}