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.

Customizable

Control size, color, opacity, speed 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

Multiple modes: outline mode, interactive-only, customizable center dot. 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}
        hideDefaultCursor={true}
        hoverColor="#3c096c"
        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
  });

  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,
  hideDefaultCursor: true,
  hoverColor: "#3c096c",
  hoverEffect: {
    scale: 1.8,
    color: "#3c096c",
    opacity: 0.5,
  },
});

// Initialize the cursor
cursor.init();

API Reference

All available props to customize Aura Cursor:

PropTypeDefaultDescription
sizenumber30Cursor size in pixels
colorstring"#3b82f6"Main cursor color (hex, rgb, etc)
opacitynumber0.5Cursor opacity (0-1)
speednumber0.2Animation speed (0-1)
hideDefaultCursorbooleantrueHide browser default cursor
outlineModebooleanfalseEnable outline mode (outline only)
outlineWidthnumber2Outline width in pixels
centerDotColorstring"#3b82f6"Center dot color
centerDotSizenumber10Center dot size in pixels
hoverColorstring"#3c096c"Color when hovering interactive elements
centerDotHoverColorstring"#3c096c"Center dot color on hover
hoverEffectobject-Effects applied on hover
hoverEffect.scalenumber1.8Cursor scale on hover
hoverEffect.colorstring"#3c096c"Cursor color on hover
hoverEffect.opacitynumber0.5Cursor opacity on hover

Interactive Elements

Hover over the elements below to see the cursor effects:

Link


Cursor Controls

Basic

30
0.5
0.2

Center Dot

10

Outline

Hover

1.8
0.5

Options

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