
Blur Text
Text
A cursor-following spotlight text effect that brightens the words under the pointer in a short paragraph, for statements, mission lines, and dark landing-page sections.
Spotlight Text renders a paragraph in a muted base colour and lays an identical copy in the spotlight colour on top, masked by a radial gradient that follows the cursor. Wherever the pointer moves, the words underneath brighten, and the spotlight fades out when the pointer leaves.
Best on a short, high-emphasis statement: a mission line, a manifesto paragraph, a section opener. The copy is hard-coded in the component, so edit the source to change it; props cover size, alignment, colours, spotlight radius and smoothing. Avoid it on body copy, errors, legal text, or instructions, where legibility cannot be negotiable.
The thing to watch is the duplicate copy. On desktop both paragraphs are real HTML text and the spotlight layer is not marked aria-hidden, so screen readers may read the statement twice; add aria-hidden to the overlay in your copy of the source if that matters. With reduced motion the cursor spotlight stays on and simply tracks the pointer without smoothing.
import SpotlightText from "@/components/effects/spotlight-text"; const page = () => { return ( <> <div className="h-screen flex flex-col items-center mx-auto justify-center gap-25 bg-black"> <SpotlightText size="text-3xl" className="max-w-4xl mx-auto max-sm:w-[80%] max-md:w-[90%]" /> </div> </> );}; export default page;A sustainability report microsite can use Spotlight Text on a short impact statement near the top of the page. The sentence starts in a muted tone, and a soft highlight follows the visitor's cursor, brightening the words underneath as they read across the claim.
The outcome is focus. On touch devices and smaller screens the full sentence shows in the highlight colour instead, so the statement never depends on hover to be read. Detailed figures and methodology sit below as ordinary text.
Avoid it on body copy, labels, error and legal text, or any wording that has to be read on sight.
Nothing is split or re-laid out: the spotlight is a CSS radial-gradient mask positioned by custom properties updated in a requestAnimationFrame loop, which pauses when the text is offscreen or the tab is hidden. Keep the paragraph short, since the overlay duplicates every word.
The text is never split into characters, but on desktop the paragraph exists twice (the muted base and the spotlight copy), and the copy is not aria-hidden, so assistive technology may hear it twice. Below 1025px or on touch devices only one paragraph renders, in the spotlight colour.
| Prop | Type | Default | Description |
|---|---|---|---|
baseTextColor | string | #525252 | Dim base text color. |
spotlightColor | string | #ffffff | Text color inside the spotlight. |
lerp | number | 0.08 | Pointer-follow smoothing amount; higher values track faster. |
spotlightSize | number | 220 | Spotlight radius in pixels. |
smoothness | number | 0.12 | Spotlight opacity smoothing amount. |
Use it when a short statement should invite the visitor to explore it with the cursor, with the words under the pointer lighting up.
The full text is real HTML, but on desktop the spotlight layer is a second copy of the paragraph that is not aria-hidden, so screen readers may announce it twice. If that matters, add aria-hidden="true" to the overlay paragraph in your copy of the source.
The text is genuine HTML rendered with the page, so it is indexable. On desktop the same paragraph appears twice in the DOM, once muted and once as the spotlight layer.
There is little to manage: the text is never split or animated in, and the spotlight copy is absolutely positioned over the base paragraph, so it takes no extra space. Check wrapping at the 7vw font size the component applies below 768px.
With reduced motion, the spotlight still follows the cursor on desktop, but it snaps to the pointer and fades in and out instantly instead of easing. On touch devices and screens under 1025px the whole sentence is shown in the highlight colour with no spotlight.
Need a custom effect? Tell us what to create.