Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

Cursor Text Reveal, animated React component

An ink lens follows the pointer across a card and shows a second sentence through it, dragging a tail of droplets on looser and looser springs so fast moves stretch into a drip. Press and hold (or Space) to flood the whole card with the reveal; it lets go with an overshoot.

  • Free
  • Motion Effects
  • Hover
  • Spring

Ink lens

Image lens

Like Cursor Text Reveal? 256 more are in Pro.

Pro unlocks all 256 Pro components, every template and block, and everything we release next. Cursor Text Reveal stays free.

Play with it

Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.

The first rule of motion is clarity.

Props

PropTypeDefaultWhat it does
baseText—Text everyone sees.
revealText—Text shown inside the lens. Defaults to baseText.
mode"text"Lens backdrop: solid ink, or an image / built-in gradient.
revealImage—Image URL inside the lens in image mode. Nothing is fetched unless you pass one.
revealImagePosition"center"CSS background-position for revealImage.
backgroundImage—Optional image URL behind the base text.
backgroundPosition"center"CSS background-position for backgroundImage.
maskSize120Lens radius in px while the pointer is over the card.
initialMaskSize0Lens radius at rest; 0 hides it.
smoothness0.180.04 to 0.6. Lower is snappier, higher drifts behind the pointer.
fontSize"clamp(2rem, 5.2vw, 3.6rem)"Font size for both text layers.
align"center"Text alignment.
enableGlowtrueThin ring around the lens edge.
revealBackgroundClassName—Classes for the lens backdrop; replaces the default ink fill.
baseTextClassName—Classes for the base text.
revealTextClassName—Classes for the revealed text.
containerClassName—Classes for the card.
className—Classes for both text wrappers.
autoplayfalseMoves the lens along a slow figure-eight until a real pointer arrives.

Add it to your project

  1. 1

    Set up your project once

    You need a Next.js project with Tailwind CSS and the @/ import alias. In its root folder, run this once. It creates components.json and the cn() helper in src/lib/utils.ts:

    npx shadcn@latest init -d

    Starting from nothing? The Quick Start walks through the whole thing.

  2. 2

    Connect the registry

    Run this once per project. It writes the Nexus UI entry into components.json for you:

    npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"

    Type it exactly as shown. {name} is filled in by the CLI with the component you ask for, so you never replace it.

  1. 3

    Add the component

    Run this from your project root. It adds the component, the helpers it imports and its npm packages.

    npx shadcn@latest add @nexus-labs/cursor-text-reveal
  2. 4

    Check what was added

    With a project made as in the Quick Start (a src/ folder), these files land in it:

    components/
    cursor-text-reveal/
    cursor-text-reveal.tsx
    index.ts
  3. 5

    Copying by hand? Skip the registry

    Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that cn() exists. Install the packages:

    npm install framer-motion

    Then show the source and create each file at the path it gives:

  4. 6

    Use it in a page

    Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:

    // src/app/page.tsx
    import { CursorTextReveal } from "@/components/cursor-text-reveal";
    
    export default function Page() {
      return (
        <main>
          <CursorTextReveal />
        </main>
      );
    }

Like Cursor Text Reveal? 256 more are in Pro.

Pro unlocks all 256 Pro components, every template and block, and everything we release next. Cursor Text Reveal stays free.

Guides