Phrases swap with a clean two-layer flip — old rises and fades, new rises in from below. The cleanest possible rotator.
import TextSwapAnimation from '@crazygl/hero-text-swap-animation';
export default function Page() {
return (
<TextSwapAnimation
phrases={'Design intentional.\nShip ruthlessly.\nIterate forever.'}
holdMs={1800}
transitMs={480}
textColor="#ffffff"
fontSize={88}
/>
);
}phrases (one line per phrase), holdMs (dwell time), transitMs (swap duration).textColor, fontSize, maxWidth, textAlign, lineHeight, letterSpacing, headingFontFamily, headingFontWeight.transparentBackground, bgColor.npm install @crazygl/hero-text-swap-animationThe component takes the same props you see in the live customizer on the right — every default ships poster-quality.
import TextSwapAnimation from '@crazygl/hero-text-swap-animation';
export default function Landing() {
return (
<TextSwapAnimation />
);
}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 TextSwapAnimation from '@crazygl/hero-text-swap-animation';
export default function Page() {
return (
<section>
<TextSwapAnimation
heading="Say hi."
subheading="Your new hero."
/>
<article>
<h2>Welcome</h2>
<p>Your content keeps its own voice below the hero.</p>
</article>
</section>
);
}