About
An animated text highlight that reveals a background, underline, or hand-drawn brush stroke behind a span of text when it scrolls into view.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Text Highlight to your project and fits it to your theme.
Code
How Text Highlight is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import { TextHighlight } from "@/components/ui/text-highlight";
export default function TextHighlightDemo() {
return (
<div className="flex w-full h-full min-h-[400px] items-center justify-center bg-background">
<div className="max-w-lg space-y-8 text-center text-2xl font-medium text-foreground">
<p>
This is a{" "}
<TextHighlight styleVariant="background">
background highlight
</TextHighlight>{" "}
effect.
</p>
<p>
This is an{" "}
<TextHighlight styleVariant="underline">
underline highlight
</TextHighlight>{" "}
effect.
</p>
<p>
This is a{" "}
<TextHighlight styleVariant="brush">brush highlight</TextHighlight>{" "}
effect.
</p>
</div>
</div>
);
}








