Follow Cursor

Colorful, fluid cursor trails that respond to mouse movement

Hover Me.

Installation

npx shadcn@latest add https://scrollx-ui.vercel.app/registry/followcursor.json 

Usage

import Followcursor from "@/components/ui/followcursor";
<Followcursor
  className="my-custom-class"
  style={{ height: "400px" }}
  colors={["#FF6B6B", "#4ECDC4", "#3A86FF"]}
  thickness={{ min: 20, max: 80 }}
  count={{ min: 10, max: 20 }}
  bgColor="rgba(10, 10, 20, 0.9)"
/>

API Reference

FollowCursor

The FollowCursor component creates beautiful, fluid lines that follow the user's cursor with smooth animation. It uses WebGL for high-performance rendering and provides a visually engaging interactive element.

Props

PropertyTypeDefaultDescription
classNamestring
Optional CSS class for the outer container.
styleReact.CSSProperties
Inline styles for the container.
colorsstring[]10 preset vibrant colors
Hex color strings for the lines.
thickness{ min: number; max: number }{ min: 30, max: 100 }
Line thickness range.
count{ min: number; max: number }{ min: 15, max: 25 }
Range of points per line.
bgColorstring"rgba(26, 26, 38, 1)"
Background color of the canvas.

Built withby Ahdeetai.