SVG Mask Effect
- Source
- Aceternity UI ↗
- Author
- Aceternity UI
- Licence
- Aceternity UI licence (free component)
Loading…
Hover the text and a circular mask grows under the cursor to reveal a hidden message.
Code
"use client";
import { MaskContainer } from "@/lab/aceternity/ui/svg-mask-effect";
export default function SVGMaskEffectDemo() {
return (
<div className="@container relative flex h-full w-full items-center justify-center overflow-hidden">
<MaskContainer
revealText={
<p className="mx-auto max-w-[85cqw] text-center text-[clamp(0.9rem,3.6cqw,2.25rem)] font-bold text-slate-800 dark:text-white">
The first rule of MRR Club is you do not talk about MRR Club. The second rule of MRR Club is
you DO NOT talk about MRR Club.
</p>
}
className="h-full w-full text-white dark:text-black [&_.text-4xl]:max-w-[85cqw] [&_.text-4xl]:text-[clamp(0.9rem,3.6cqw,2.25rem)]"
>
Discover the power of <span className="text-blue-500">Tailwind CSS v4</span> with native CSS
variables and container queries with <span className="text-blue-500">advanced animations</span>.
</MaskContainer>
</div>
);
}
Prompt
Build "SVG Mask Effect", a cursor animation. What it does: Hover the text and a circular mask grows under the cursor to reveal a hidden message. Write it as a single self-contained React component in TypeScript that fills its parent (w-full h-full), styled with Tailwind CSS, using motion. Technique: the Motion library, pointer tracking. It sits on a light background, in a 16:10 frame. Respect prefers-reduced-motion with a still state, pause work when the element is off screen, and keep it accessible. Original: https://ui.aceternity.com/components/svg-mask-effect (Aceternity UI, Aceternity UI licence (free component)).