Platform
VaultVault
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
ButtonsPart of ProButtons
IconsPart of ProIcons
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
SavedPart of ProSaved
Support
DocumentationDocumentation
MCP serverMCP server
SettingsSettings
VaultCursorLine Trail Cursor
Crosshair CursorBrowse all 182Curved Drawer Menu
  • Free15
  • Navigation19
  • Buttons9
  • Scroll55
  • Text27
  • Sliders & marquees19
  • Gallery & images67
  • Cursor24
  • Page transitions10
  • Loaders2
  • Backgrounds10
  • UI components33
  • Interface Essentials144
  • Social Icons69
  • Payment Badges41
Sign inSign in

Start free. The code for 15 components, no card needed.

Get 15 free

Line Trail Cursor

This one is free. Make an account and the code is yours, no card needed.

Create a free account

What you'll need.

Install

    Setup

    npm i gsap

    More like this

    • Trail
    • Line drawing
    • Canvas

    Features.

    • A small square eases after the pointer and draws the path it took as a thin line
    • The line fades towards its tail, so it reads as motion rather than a drawing
    • Stop moving and the line dissolves; the square waits where it stopped
    • Click-through overlay: drop it into any section and everything underneath stays usable
    • Plain Canvas 2D, no dependencies, crisp on high-density screens
    • Draws only while something is moving or fading; the loop stops once the line has gone, even with the pointer resting inside
    • Stays put on screen when the page scrolls under a still pointer
    • Mouse only: nothing runs on touch screens, and touch and pen are ignored elsewhere; respects prefers-reduced-motion

    How to get it right.

    Give the parent a position

    The overlay fills its parent with position: absolute; inset: 0, so the parent needs position: relative (or any non-static position). The pointer is tracked over that parent.

    Pick the colour for the background

    The line peaks at 60% opacity and the head is small, so it needs contrast. The brand orange works on dark sections; on light ones use a dark colour via data-au-color.

    Balance follow and length

    data-au-follow sets how lazily the square chases the pointer; data-au-length sets how much of the path stays visible. A slow follow with a long trail feels drawn and deliberate; a fast follow with a short trail feels quick and precise.

    Mind the stacking

    The overlay sits at z-index: 2 inside its parent, so it draws over the section's content. Raise it if that content has its own stacking; it never blocks clicks either way.

    Variations.

    • Default — orange, 13px head, 2.2px line, follow 0.18, 48 points
    • Fine pen — data-au-size="4", data-au-line-width="0.8", data-au-follow="0.3"
    • Lazy ribbon — data-au-follow="0.06", data-au-length="84", data-au-line-width="2"
    • Mono — data-au-color="#fffcf2" for a quiet, neutral cursor on dark sections

    Where it fits.

    • Hero of a studio or portfolio site — a quiet signature that rewards moving the mouse
    • Showreel or case study header — a precise, technical accent over imagery
    • Contact or footer section — a small moment of play where people linger

    Frequently asked.

    Check the parent element has a size and a position, and that you're on a device with a mouse or trackpad: the trail is hidden on touch screens.

    Yes — put it directly inside a position: relative wrapper around the page content. Don't use a position: fixed wrapper: left clickable it blocks the page, and with pointer-events: none it never hears the pointer. The canvas is as tall as its parent, so on a long page keep it to a section if you can.

    Don't. The square eases behind the pointer, so it can't stand in for it, and people lose the cursor if the script fails to load.

    Set data-au-color on the root and call window.au.CursorTrail.refresh(root). To drive it from CSS, leave data-au-color empty and set --ctr-color; it's read once at init too.

    No. It's plain Canvas 2D with no dependencies.

    Related components.

    Free

    Dither Reveal Cursor

    Cursor

    Pro

    Cursor Push Tags

    Cursor

    Pro

    Mesh Gradient Hero

    Cursor