Interactive Cursor

Spring-smoothed cursor overlay with magnetic hover states, click ripples, optional particles, and support for full-page or container-scoped interactions.

UniqueUI CLI

npx uniqueui add interactive-cursor

shadcn CLI

npx shadcn@latest add https://uniqueui.com/r/interactive-cursor.json -y

shadcn path expects @/lib/utils (run shadcn init first). Same source file is installed to components/ui/.

Preview

Spring Physics · Magnetic Snap · Click Particles

Interactive Cursor

Move inside this card. Hover buttons to see magnetic pull. Click anywhere for burst particles.

Pass hideSystemCursor to fully replace the native cursor

Usage

"use client";
import { useRef } from "react";
import { InteractiveCursor } from "@/components/ui/interactive-cursor";

export default function Example() {
  const containerRef = useRef<HTMLDivElement>(null);

  return (
    <div
      ref={containerRef}
      className="relative h-[400px] w-full overflow-hidden rounded-xl border border-neutral-800 bg-neutral-950"
    >
      <div className="relative z-10 flex h-full items-center justify-center">
        <button
          type="button"
          data-magnetic="true"
          className="rounded-full bg-white px-6 py-3 font-semibold text-black"
        >
          Hover me
        </button>
      </div>

      <InteractiveCursor
        containerRef={containerRef}
        color="#a855f7"
        clickColor="#b280ff"
        trailColor="rgba(168, 85, 247, 0.35)"
      />
    </div>
  );
}

Props

PropTypeDescription
colorstringPrimary color for the cursor dot.
clickColorstringRipple and particle color used on click.
glowbooleanEnables the trailing glow around the cursor.
trailColorstringColor of the outer ring and trailing glow.
particleEffectbooleanWhether click interactions emit particles.
magneticPullbooleanSnaps the cursor toward interactive elements such as buttons and links.
hideSystemCursorbooleanHides the native cursor while the component is mounted.
containerRefRefObject<HTMLElement | null>Optional ref limiting the interaction area to a specific container instead of the full window.
classNamestringAdditional classes applied to the overlay root.