Custom Cursor

Replaces the browser cursor with an animated SVG icon and optional label that follows the pointer.

Figma
Design
MJ
100%

Welcome

Get started with your new app

Placeholder
Get Started
Ready
1 selected

Custom Cursor swaps the default mouse pointer for a branded React-rendered SVG marker that trails the cursor with easing. Hover states on interactive elements swap the icon and surface a small label, and multiple cursor variants can coexist on a single page. Built with React and Tailwind CSS. Often used on portfolio sites, case study heroes, and product showcases that want a distinct browsing feel.

Installation

Usage

import { Cursor } from "@/components/ui/custom-cursor";

Basic Usage

<Cursor name="John Doe" cursorColor="sky">
  <div className="h-[400px] w-full bg-gradient-to-br from-blue-50 to-indigo-100 rounded-lg p-8">
    <h2 className="text-2xl font-bold text-gray-800 mb-4">
      Hover over this area
    </h2>
    <p className="text-gray-600">
      The custom cursor will appear when you hover over this content.
    </p>
  </div>
</Cursor>

With Custom SVG

const HeartIcon = () => (
  <svg viewBox="0 0 24 24" fill="currentColor" className="w-6 h-6">
    <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
  </svg>
)
 
<Cursor
  name="Designer"
  cursorColor="pink"
  customSVG={<HeartIcon />}
  svgClassName="text-pink-500"
>
  <div className="h-[400px] w-full bg-pink-50 rounded-lg p-8">
    <h2 className="text-2xl font-bold text-pink-800 mb-4">Custom Heart Cursor</h2>
    <p className="text-pink-600">This area uses a custom heart icon as the cursor.</p>
  </div>
</Cursor>

Props

Cursor Component

PropTypeDefaultDescription
childrenReact.ReactNodeRequiredContent to render with the custom cursor effect.
classNamestringundefinedAdditional CSS classes to apply to the container.
namestringRequiredName displayed next to the cursor pointer.
customSVGReact.ReactNodeundefinedCustom SVG icon to use instead of the default pointer.
svgClassNamestringundefinedAdditional CSS classes to apply to the SVG icon.
cursorColorstring"sky"Color for the cursor. Named preset ("sky", "red", ...) or any CSS color string (e.g. "rose", "#e11d48").

FollowCursor Component

PropTypeDefaultDescription
xMotionValue<number>RequiredX position motion value for the cursor.
yMotionValue<number>RequiredY position motion value for the cursor.
namestringRequiredName displayed next to the cursor pointer.
customSVGReact.ReactNodeundefinedCustom SVG icon to use instead of the default pointer.
svgClassNamestringundefinedAdditional CSS classes to apply to the SVG icon.
cursorColorstring"sky"Color for the cursor. Named preset ("sky", "red", ...) or any CSS color string (e.g. "rose", "#e11d48").