YoucefBnm Bnm

Custom Cursor

Heroes 40

About

• Smooth cursor movement using spring • Configurable cursor variants "customCursorVariants" • Change cursor variant and text with "useSetCursorVariant()" hook • Change variant with "setCursorVariant()" • Change text with "setCursorText()"

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

Code

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

Usage.tsx

"use client"

import { Button } from "@/components/ui/button"
import { CustomCursor, useSetCursorVariant } from "@/components/ui/custom-cursor"

export function CustomCursorDemo () {
    const { cursorVariant, setCursorVariant, cursorText, setCursorText } = useSetCursorVariant()

    return (
    <>
      <CustomCursor variant={cursorVariant} text={cursorText} />

      <div className="bg-zinc-900 px-6 py-12 md:px-8 xl:px-12">
        <div className="md:grid-cols-2 grid grid-cols-1 grid-flow-row items-center gap-8">
          <div className="flex flex-col gap-4">
            <div className="flex flex-col gap-4">
              <h1 className="text-5xl font-medium text-white">
                Crafting{" "}
                <span className="text-teal-500">Digital Experiences</span>{" "}
                Through Design
              </h1>
              <p className="tracking-tight text-muted/80">
                Leading web design agency, dedicated to crafting exceptional
                online experiences for businisses worldwide with passion for
                crativity and a commitment to excellence, We specialize in
                transforming visions into reality.
              </p>
            </div>
            <div className="my-8">
              <Button
                onMouseEnter={() => setCursorVariant("sm")}
                onMouseLeave={() => setCursorVariant("default")}
                className="rounded-full"
                size="lg"
                variant={"secondary"}
              >
                Start your project
              </Button>
            </div>
          </div>
          <div
            className="aspect-square rounded-md bg-muted size-40 md:size-auto"
            onMouseEnter={() => setCursorText("View Project")}
            onMouseLeave={() => setCursorText("")}
          />
        </div>
      </div>
    </>
  )
}

Dependencies

More by YoucefBnm Bnm

View all
  • Animated Slideshow

    Animated Slideshow

    2.2K
  • Hero Gallery Scroll Animation

    Hero Gallery Scroll Animation

    1.5K
  • Animated Gallery

    Animated Gallery

    1.4K
  • Animated Video on Scroll

    Animated Video on Scroll

    1.4K
  • Animated Cards Stack

    Animated Cards Stack

    1.3K
  • Cards Stack

    Cards Stack

    1.1K
  • cta section with gallery

    cta section with gallery

    672
  • Hero Video

    Hero Video

    538

More in Heroes

View all
  • SaaS Template

    SaaS Template

    2.4K
  • Responsive Hero Banner

    Responsive Hero Banner

    2K
  • Hero

    Hero

    1.2K
  • Centered Hero with Image Fan

    Centered Hero with Image Fan

    931
  • Editorial Collage Hero

    Editorial Collage Hero

    430
  • Glass Fold

    Glass Fold

    212
  • Minimalist Hero Fashion

    Minimalist Hero Fashion

    285
  • HeroSectionWithGradient

    HeroSectionWithGradient

    336