A React library for custom cursors with TypeScript support.
- Images for custom cursors must be a maximum of 128x128 pixels due to browser limitations.
npm install react-cursor-fximport { Cursor } from 'react-cursor-fx';
// Default cursor on body
<Cursor type="custom" size={30} imageUrl="/cursor.png" />
// Cursor on specific element with ref
const ref = useRef(null);
<Cursor type="pointer" targetElement={ref} />
<section ref={ref}>...</section>
// Cursor with CSS selector
<Cursor type="crosshair" targetElement=".my-class" />-
type: Cursor type (e.g., "default", "pointer", "crosshair", "custom"). -
size: Size in pixels (default: 20). -
imageUrl: URL for custom cursor image. -
targetElement: Ref or CSS selector for specific element.