Edu Calvo

Cursor Follow

Galleries 155

About

A cursor-follow component that displays context-sensitive text when hovering over elements. Demo shows two images with different hover texts.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Cursor Follow to your project and fits it to your theme.

Code

How Cursor Follow is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client"

import React from "react"

import CursorFollow from "@/components/ui/cursor-follow" 

const images = [
  {
    src: "https://cdn.21st.dev/assets/mirror/9f/9fc5a18a3acb56e3e19415fb85be930677efc949e2494f468f658adbb2ed993b.jpg",
    label: "A beautiful forest probando el largo limite del texto",
  },
  {
    src: "https://cdn.21st.dev/assets/mirror/f8/f8204e3dd4b408d97af22680966491d8f8e24e1ce4897ecc94dff0d33db02694.jpg",
    label: "Mountain at sunset",
  },
]

const CursorFollowDemo = () => {
  return (
    <CursorFollow>
      <div className="flex flex-row items-center justify-center gap-8 py-8">
        {images.map((img, i) => (
          <div key={i} className="flex flex-col items-center">
            <img
              src={img.src}
              alt={img.label}
              data-cursor-text={img.label}
              className="border-background h-48 w-48 rounded-xl object-cover transition-transform duration-200 hover:scale-105"
              style={{ cursor: "none" }}
            />
          </div>
        ))}
      </div>
    </CursorFollow>
  )
}

export default CursorFollowDemo

Dependencies

More by Edu Calvo

View all
  • Scrollable Card Stack

    Scrollable Card Stack

    240
  • AI Task List

    AI Task List

    167
  • Siri Orb

    Siri Orb

    164
  • Pixel Flow Field

    Pixel Flow Field

    157
  • Agent Avatar

    Agent Avatar

    136
  • Gravity Stars

    Gravity Stars

    124
  • Coverflow Carousel

    Coverflow Carousel

    110
  • Otp Input

    Otp Input

    93

More in Galleries

View all
  • Animated Gallery

    Animated Gallery

    1.5K
  • Editorial Collage Hero

    Editorial Collage Hero

    458
  • Image Gallery

    Image Gallery

    1.4K
  • Thumbnail image viewer

    Thumbnail image viewer

    64
  • Elastic Gallery

    Elastic Gallery

    958
  • 3D Parallax Unfurling Gallery

    3D Parallax Unfurling Gallery

    1K
  • Img Sphere

    Img Sphere

    2.1K
  • Shared Element Gallery

    Shared Element Gallery

    446