Features
- π― Smooth physics-based cursor animations
- π Rotation effects based on movement direction
- β‘ Performance optimized with RAF
- π¨ Fully customizable cursor design
- π¦ Lightweight and easy to implement
Installation
Usage
showLineNumbers
showLineNumbers
Hiding Default Browser Cursor
To prevent the default browser cursor from overlapping with the custom cursor, add the following CSS globally:showLineNumbers
Optional: Keep text cursor for inputs
showLineNumbers
showLineNumbers
Props
| Prop | Type | Default | Description |
|---|---|---|---|
cursor | React.ReactNode | <DefaultCursorSVG /> | Custom cursor component to replace the default cursor |
springConfig | SpringConfig | See below | Configuration object for the spring animation behavior |
SpringConfig Type
showLineNumbers
Default Spring Configuration
showLineNumbers
Browser Support
Compatible with all modern browsers that support:requestAnimationFrame- CSS transforms
- Pointer events
Accessibility
When using this component, consider that:- Users navigating via keyboard will not see the custom cursor
- You may want to provide alternative visual cues for interactive elements
- Some users may have motion sensitivity, so consider providing a way to disable the animation
Credits
- Credit to @Code_Parth for the original concept and implementation