Smooth Cursor
A customizable, physics-based smooth cursor animation component for React applications.
Move your mouse aroundTap anywhere to see the cursor
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
CLI
Manual
Copy and paste the following code into your project.
Update the import paths to match your project setup.
Usage
Import and use the component.
Props
Prop | Type | Default | Description |
---|---|---|---|
cursor | JSX.Element | <DefaultCursorSVG /> | Custom cursor component to replace the default cursor |
springConfig | SpringConfig | See below | Configuration object for the spring animation behavior |
SpringConfig Type
Default Spring Configuration
Browser Support
Compatible with all modern browsers that support:
requestAnimationFrame
- CSS transforms
- Pointer events
Accessibility
- Users navigating via keyboard will not see the custom cursor
- Consider providing alternative visual cues
- Provide a toggle if users have motion sensitivity
Credits
- Credit to @Code_Parth for the original concept and implementation