Target Cursor
A custom cursor with targeting animation and corner tracking
Configuring your account...
Please wait while we prepare everything for you
Usage
import { useRef } from 'react';
import TargetCursor from './TargetCursor';
const Component = () => {
const containerRef = useRef(null);
return (
<div ref={containerRef} style={{ height: '300px', overflow: 'hidden' }}>
<TargetCursor
spinDuration={2}
hideDefaultCursor={true}
color="#ffffff"
/>
<h1>Hover over the elements below</h1>
<button className="cursor-target">Click me!</button>
<div className="cursor-target">Hover target</div>
</div>
);
};Props
| Prop | Type | Default | Description |
|---|---|---|---|
targetSelector | string | '.cursor-target' | CSS selector for target elements |
spinDuration | number | 2 | Duration of the spin animation in seconds |
hideDefaultCursor | boolean | true | Whether to hide the default cursor |
color | string | '#ffffff' | Color of the cursor elements |
CSS Classes
Add the cursor-target class to elements you want the cursor to target:
.cursor-target {
/* Your element styles */
}