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

Text Masking

Headline acts as a window onto a slowly drifting photograph — large letterforms, the photograph showing through them, a clean colored hero around the cut-out.

ReactImageInteractiveFont#mask#image#typography

Usage

import TextMasking from '@crazygl/hero-text-masking';

export default function Hero() {
  return (
    <TextMasking
      heading="wild"
      image="https://crazygl.com/samples/nature1.avif"
      driftSpeed={0.4}
    />
  );
}

Customise

  • Contentheading, subheading, image (the masked photo).
  • DriftdriftSpeed, driftAmount (idle pan), parallaxStrength (pointer parallax).
  • TypographyfontSize, headingFontFamily, headingFontWeight, letterSpacing, subColor.
  • BackdroptransparentBackground, bgColor.

Best for

  • Bold editorial and brand hero statements.
  • Travel, nature, fashion, and photography sites.
  • Product or campaign launches where one word carries the imagery.
01 · Install the package

One command, zero config.

npm install @crazygl/hero-text-masking
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 TextMasking from '@crazygl/hero-text-masking';

export default function Landing() {
  return (
    <TextMasking />
  );
}
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 TextMasking from '@crazygl/hero-text-masking';

export default function Page() {
  return (
    <section>
      <TextMasking
        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

Text Reveal

Heading wiped in from a single direction via a hard clip-path mask, with a small per-letter delay — the foundational reveal everyone needs.

Mask Text Reveal

Text revealed as a moving circular mask sweeps across — the headline appears only where the image-shaped mask uncovers it.

Text Image Cursor

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

Scroll Reveal Pro

Multi-line heading where each line is masked and rises into view as the visitor scrolls — staggered, eased, with a small blur dropoff.

Gradient Text

Heading filled with a slowly drifting multi-stop linear gradient — three configurable colours, customizable angle, optional animation.

Masked Text Carousel

A big heading sits behind a product image; where the image overlaps the words the text shows only its outline (or inverts, or ghosts) while the rest stays solid — the product literally masks the type. Swipeable, with a floating, pointer-reactive product and smooth slide transitions.
Live customizer

Text Masking

Drift speed0.4Drift amount (%)8%Pointer parallax0.5Font size320pxFontWeight900Letter spacing-0.04emSubheading colourTransparent backgroundBackgroundInteractivityWhich input drives the hero — try Scroll if you want the page to drive motion.
CrazyGL · crazygl.comProgrammable hero sections for real websites.