Component
Mouse Follow
A smooth mouse follower component that creates a custom cursor using GSAP. The cursor smoothly follows mouse movement and can scale on hover over interactive elements.
Installation
Interactive Demo
Try out different prop combinations and default variants and see the results in real-time.
In your own project you can add your own variants and expand on this starting point.
Move your mouse around
Enable custom cursor in the settings below
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode | - | Custom cursor element to render (replaces default cursor) |
| ease | number | 0.15 | How quickly the cursor follows the mouse (0-1, higher is faster) |
| hideDefaultCursor | boolean | true | Whether to hide the default system cursor |
| hoverScale | number | 1.5 | Scale factor when hovering over interactive elements |
| enableHoverScale | boolean | true | Whether to enable hover scaling on interactive elements |
| offset | { x: number; y: number } | { x: 0, y: 0 } | Offset from the actual cursor position (in pixels) |
| disableOnMobile | boolean | true | Whether to disable on mobile and tablet devices |
Source Code
The complete source code for this component.