A cursor-driven lens that reveals the bright real colour of a heading from underneath a dim default. Five lens shapes — circle, rectangle, diamond, wave, star — with an optional gradient fill on the revealed text.
import TextRevealLens from '@crazygl/hero-text-reveal-lens';
export default function Page() {
return (
<TextRevealLens
heading="REVEAL"
maskShape="circle"
maskSize={220}
useGradient
gradientStart="#ff6b6b"
gradientEnd="#4ecdc4"
/>
);
}heading (the wordmark).maskShape (circle / rectangle / diamond / wave / star), maskSize (80–600px), edgeSoftness.showHiddenText + hiddenColor (outside the lens), useGradient with gradientStart/gradientEnd, or flat revealedColor.fontSize, letterSpacing, headingFontFamily, headingFontWeight.transparentBackground, bgColor.npm install @crazygl/hero-text-reveal-lensThe component takes the same props you see in the live customizer on the right — every default ships poster-quality.
import TextRevealLens from '@crazygl/hero-text-reveal-lens';
export default function Landing() {
return (
<TextRevealLens />
);
}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 TextRevealLens from '@crazygl/hero-text-reveal-lens';
export default function Page() {
return (
<section>
<TextRevealLens
heading="Say hi."
subheading="Your new hero."
/>
<article>
<h2>Welcome</h2>
<p>Your content keeps its own voice below the hero.</p>
</article>
</section>
);
}