uiable

Text Highlight

Component 22

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>
  );
}

Dependencies

More by uiable

View all
  • Feature Highlights Grid

    Feature Highlights Grid

    341
  • Card Tabs

    Card Tabs

    101
  • Financial Bento Grid

    Financial Bento Grid

    71
  • Chart Tooltip

    Chart Tooltip

    67
  • Portfolio Showcase Grid

    Portfolio Showcase Grid

    58
  • Marketing Hero Section

    Marketing Hero Section

    58
  • Sidebar with Search and Profile

    Sidebar with Search and Profile

    50
  • Position Sonner

    Position Sonner

    48