Docs / Components / Spotlight Text

Spotlight Text

Dim a block of text and sweep a soft cursor-following spotlight across it to reveal the bright letters underneath on hover.

Sweep a soft cursor-following spotlight across this text block to reveal the hidden brilliance underneath. Designed for modern web applications with smooth lerp tracking, fully customizable spotlight radius, intensity controls, and rich typography support.

Dependencies

Install the following dependencies to use this component:

1npm install clsx tailwind-merge

Installation

Run the following command in your terminal to add the component to your project:

1npx rankflow-ui@latest add spotlight-text

Props Reference

PropTypeDefaultDescription
textstring'Sweep a soft cursor-following spotlight across this text block to reveal...'The text content to display.
childrenReactNode-Custom React node text content if text prop is not used.
spotlightRadiusnumber120Spotlight radius in pixels (20 to 700 px).
brightColorstring'rgb(255, 255, 255)'Color of the bright revealed text layer.
dimColorstring'rgba(255, 255, 255, 0.2)'Color of the base dimmed text layer.
intensitynumber20Solid core percentage before the soft edge fade starts (0 to 100).
followSpeednumber0.08Smoothness factor for cursor following lerp (0.01 = very slow/smooth, 1 = instant).
transitionDurationnumber0.3Transition duration for opening/closing reveal effect in seconds.
transitionTimingstring'cubic-bezier(0.16, 1, 0.3, 1)'CSS transition timing function for spotlight reveal.
hideCursorbooleantrueWhether to hide native cursor on hover.
classNamestring''Additional CSS classes.
styleCSSProperties-Custom styles for font family, size, weight, spacing, alignment, etc.