A heading whose letterforms are filled with a photograph. Uses native CSS background-clip:text so the wordmark stays selectable and crisp at any zoom, with cover, contain, or custom-percent fit modes.
import ImageMaskedText from '@crazygl/hero-image-masked-text';
export default function Page() {
return (
<ImageMaskedText
heading="Editorial"
image="/photos/cover-shoot.jpg"
imageFit="cover"
bgColor="#f4ede0"
/>
);
}Plug in any photograph (JPG / PNG / WebP / AVIF). High-contrast subjects centred in the frame read best, so the letters land on the interesting parts. (The companion hero text-video-mask does the same effect for video sources.)
heading, subheading, optional ctaLabel / onCTAClick.image, imageFit (cover / contain / percent), imagePercent, imageOffsetX / imageOffsetY.fontSize, headingFontFamily / headingFontWeight (800–900 maximises visible image), letterSpacing, lineHeight, textAlign, fallbackTextColor.transparentBackground, bgColor, vignetteStrength.npm install @crazygl/hero-image-masked-textThe component takes the same props you see in the live customizer on the right — every default ships poster-quality.
import ImageMaskedText from '@crazygl/hero-image-masked-text';
export default function Landing() {
return (
<ImageMaskedText />
);
}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 ImageMaskedText from '@crazygl/hero-image-masked-text';
export default function Page() {
return (
<section>
<ImageMaskedText
heading="Say hi."
subheading="Your new hero."
/>
<article>
<h2>Welcome</h2>
<p>Your content keeps its own voice below the hero.</p>
</article>
</section>
);
}