Overview
Import MaskedHeading from the masked-heading entry and pass the copy as a string child. It renders an h2 by default; set level for h1–h6. Without src, the selected appearance shows a tokenized gradient mesh. Pass an image URL, or set mediaType="video" for a muted looping clip with an optional poster.
The defaults are reveal rise, trigger view, duration 1100 ms, stagger 90 ms, delay 0, parallax 24 px, drift 16 px, size lg, align start, and appearance aurora. The view trigger starts once a quarter of the heading is visible, and onRevealComplete fires when the entrance ends.
The letters are measured after layout and re-measured when the heading resizes or web fonts load. Consumers using Tailwind v4 must include the package in their @source scan so both light and dark token classes are generated.
Common use cases
- Landing page and campaign hero headlines.
- Section openers in editorial and portfolio layouts.
- Product launch pages that pair a headline with brand imagery.
FAQ
Is the heading still readable by screen readers and search engines?
Yes. The copy is ordinary text inside a real h1–h6 element. The media and the SVG mask are aria-hidden, and the mask's letters are written in the browser, so server HTML contains the heading text once.
Does it need GSAP, Framer Motion, canvas or WebGL?
No. It uses an SVG clipPath, CSS transforms, and one requestAnimationFrame loop that pauses off-screen and stops once the media is still.
What happens with reduced motion, touch, or no JavaScript?
Reduced motion shows the final heading at once, keeps the media still, and never plays video. Touch input does not move the media. Without scripts, or with forced colors, the heading renders as plain text.
