The CustomCursor overrides standard pointer cursors, binding a custom pointer dot alongside a delayed trailer shape. It actively listens for hovers over interactive elements (a, button, input) to trigger animated active states. Now rewritten without GSAP (using native physics) and featuring 5 unique cursor styles.
Live Preview
Move your mouse
The custom cursor overrides the native pointer. Try hovering over the interactive elements below.
Trailing Dot:A small solid dot with an outer ring that smoothly trails behind your cursor.
Installation
npx kinetic-ui-cli@latest add cursor-followerArchitecture
- Zero Dependencies: Previously relied on GSAP. Now entirely driven by native
requestAnimationFrameand linear interpolation (Lerp). This cuts bundle size and guarantees 60/120fps sync with the display. - Mix Blend Mode: Uses
mix-blend-differenceto ensure the cursor remains visible regardless of whether the background is light or dark. - Auto-Hide: Listens to
mouseleaveon the document root to hide the cursor when the user leaves the browser window.
Props
Usage Tips
When using a custom cursor, you generally want to hide the native OS cursor. Add the cursor-none class to your main container or <body> tag. Ensure interactive elements (buttons, links) also have cursor-none if you want the custom cursor to persist over them.
Variants
| Variant | Idle State | Hover State |
|---|---|---|
| dot | Solid center dot + trailing outline | Outline scales up 2.5x and fills |
| ring | Clean hollow ring (no center dot) | Scales up and fills |
| glow | Emits large ambient shadow/halo | Shadow intensifies and solidifies |
| morph | Standard circle | Border radius morphs into rounded square |
| magnet | Standard circle | Massively expands and becomes a dashed border |
Usage Guide
1. Import the Component
Import the component into your React or Next.js page:
import { CursorFollower } from "@/components/creative/custom-cursor";
2. Implementation Example
Render the component and customize its behavior by passing props:
import { CursorFollower } from "@/components/creative/custom-cursor";
export default function Example() {
return (
<div className="w-full flex items-center justify-center p-8">
<CursorFollower
/>
</div>
);
}