Skip to main content
André Barros
Aura Cursor Logo

Aura Cursor

A lightweight, customizable library for creating custom cursors in modern web applications. Create beautiful cursors that follow your mouse with smooth animations and interactive hover effects. Try the controls on the side to see different configurations in real-time.

ReactTypeScriptNext.js

Customizable

Control size, color, opacity, speed, lag, shape and much more through simple props. Full TypeScript support.

Performance

Optimized for performance with smooth animations using requestAnimationFrame. Small bundle size and zero dependencies.

Smart Detection

Automatically detects interactive elements (links, buttons, etc.) and applies special hover effects. Automatically hides when the mouse leaves the window.

Flexible

Trail, magnetic snap, click pulse, outline mode, interactive-only and custom shapes. Works with React, HTML/JavaScript and TypeScript.


Installation

npm install aura-cursor

Or using yarn:

yarn add aura-cursor

Or using pnpm:

pnpm add aura-cursor

How to Use

Basic example with React:

import { AuraCursor } from "aura-cursor/react";

function App() {
  return (
    <>
      <AuraCursor
        size={30}
        color="#3b82f6"
        opacity={0.5}
        speed={0.2}
        lag={1.4}
        easing="easeOut"
        hideDefaultCursor
        shape="rounded"
        hoverColor="#3c096c"
        trail={{ length: 6, fade: 0.55, scale: 0.92 }}
        clickEffect={{ scale: 0.7, duration: 160 }}
        magnetic={{ strength: 0.4, padding: 48 }}
        hoverEffect={{
          scale: 1.8,
          color: "#3c096c",
          opacity: 0.5,
        }}
      />
      <YourApp />
    </>
  );
}

Or using the hook:

import { useAuraCursor } from "aura-cursor/react";

function App() {
  useAuraCursor({
    size: 30,
    color: "#3b82f6",
    opacity: 0.5,
    speed: 0.2,
    trail: { length: 4 },
    clickEffect: true,
  });

  return <div>Your app content</div>;
}

Or using vanilla JavaScript:

import { AuraCursor } from "aura-cursor";

const cursor = new AuraCursor({
  size: 30,
  color: "#3b82f6",
  opacity: 0.5,
  speed: 0.2,
  lag: 1.8,
  easing: "easeOut",
  hideDefaultCursor: true,
  shape: "rounded",
  hoverColor: "#3c096c",
  trail: { length: 6, fade: 0.55, scale: 0.92 },
  clickEffect: { scale: 0.7, duration: 160 },
  magnetic: { strength: 0.4, padding: 48 },
  hoverEffect: {
    scale: 1.8,
    color: "#3c096c",
    opacity: 0.5,
  },
});

cursor.init();

API Reference

All available props to customize Aura Cursor:

PropTypeDefaultDescription
sizenumber20Cursor size in pixels
colorstring"#000000"Main cursor color (hex, rgb, etc)
opacitynumber0.5Cursor opacity (0-1)
speednumber0.3Mouse follow speed (0-1)
lagnumber1Delay multiplier (higher = more lag)
easingstring"linear"Interpolation easing toward the target (linear | easeOut)
hideDefaultCursorbooleanfalseHide browser default cursor
interactiveOnlybooleanfalseShow cursor only on interactive elements
outlineModebooleanfalseEnable outline mode (outline only)
outlineWidthnumber2Outline width in pixels
centerDotColorstring-Center dot color
centerDotSizenumber3Center dot size in pixels
hoverColorstring-Color when hovering interactive elements
centerDotHoverColorstring-Center dot color on hover
shapestring"circle"Cursor shape (circle | square | rounded)
blurnumber-CSS blur in pixels
mixBlendModestring-CSS mix-blend-mode (e.g. difference)
zIndexnumber9999Cursor z-index
borderRadiusstring | number-Overrides shape border radius
customCursorHTMLElement | string-Custom HTML content inside the cursor
trailobject-Ghost trail behind the cursor
trail.lengthnumber0Number of ghost elements (0 disables trail)
trail.fadenumber0.6Opacity multiplier for trail ghosts
trail.scalenumber0.95Scale falloff per ghost
clickEffectboolean | object-Scale pulse on click
clickEffect.scalenumber0.75Scale while pressing
clickEffect.durationnumber150Restore duration in ms
magneticboolean | object-Snap toward interactive element centers
magnetic.strengthnumber0.35Pull strength toward element center (0-1)
magnetic.paddingnumber40Extra hit area around the element in px
interactiveSelectorstring-Extra/override CSS selector for interactive elements
excludeSelectorstring-Elements matching this selector are never interactive
hoverEffectobject-Effects applied on hover
hoverEffect.scalenumber1.5Cursor scale on hover
hoverEffect.colorstring-Cursor color on hover
hoverEffect.opacitynumber-Cursor opacity on hover
onHoverInteractivefunction-Fires when interactive hover state changes
onClickfunction-Fires on mouse down

Interactive Elements

Hover over the elements below to see the cursor effects:

Link

Aura Cursor - React Library for Custom Cursor | André Barros