FINDING YOUR DIRECTION

0%
← Scrollhaus Journal

Website Animation Guides · Published · Updated · 5 min read

Animated Cursor Effects for Websites: A Lightweight Custom Cursor Example

A useful cursor effect responds to pointer movement without hiding links, blocking clicks or making touch users miss content.

Published by Amanjot Singh, founder of Scrollhaus. AI-assisted editorial work; product context, sources and corrections are documented in our editorial methodology.

Pawspace cat website with a pointer-responsive visual scene
Scrollhaus Journal · Website Animation Guides

Animated cursor effects can make a creative website feel responsive, but they are easy to overuse. A small ring, glow or trail confirms where the pointer is. It should never be the only way to discover a button, reveal product information or control scrolling.

Copy a lightweight pointer follower

This plain JavaScript example adds a decorative ring without hiding the system cursor. It follows desktop pointer movement, ignores touch movement, and cannot intercept a click because the overlay has pointer-events set to none. It schedules no more than one transform update per animation frame.

<div class="cursor-dot" aria-hidden="true"></div>
<style>
.cursor-dot { position: fixed; top: 0; left: 0; width: 18px; height: 18px;
  border: 1px solid currentColor; border-radius: 50%;
  pointer-events: none; z-index: 20; opacity: 0;
  transform: translate3d(-50px,-50px,0); }
@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor-dot { display: none; }
}
</style>
<script>
const dot = document.querySelector('.cursor-dot');
let x = 0, y = 0, queued = false;
window.addEventListener('pointermove', event => {
  if (!dot || event.pointerType === 'touch') return;
  x = event.clientX;
  y = event.clientY;
  dot.style.opacity = '1';
  if (queued) return;
  queued = true;
  requestAnimationFrame(() => {
    dot.style.transform = 'translate3d(' + x + 'px,' + y +
      'px,0) translate(-50%,-50%)';
    queued = false;
  });
}, { passive: true });
document.addEventListener('pointerleave', () => {
  if (dot) dot.style.opacity = '0';
});
</script>

Keep the ring subtle and away from dense text. For a brand-specific response, change its colour or size near a product hotspot, but keep links legible in their resting state. The Pawspace showcase demonstrates how pointer response can belong to a character and its story rather than every element on a page.

Choose a cursor effect that fits the task

EffectGood useRisk to test
Outline followerCreative portfolio or visual storyLag on low-power devices
Hover labelGallery item with a clear actionHidden information on touch
Particle trailBrief campaign momentExcess painting and visual clutter

If an effect adds no information, disable it for coarse pointers and reduced-motion users. Test keyboard navigation separately: a keyboard user needs visible focus styles even if the mouse has an elaborate follower. Do not hide the default cursor across the entire document just to emphasize custom art.

Types of animated custom cursor effects

The pointer follower above is one pattern. An animated custom cursor can take several forms, and each gives a different kind of interactive visual feedback.

CSS first, JavaScript when needed

The simplest custom cursor needs only CSS: cursor: url(pointer.png) 4 4, auto; swaps the image and sets the hotspot. Effects that follow the pointer need a little JavaScript, and transforms keep them GPU-accelerated for smooth motion. If the default cursor is hidden, make sure your replacement appears immediately, or visitors lose their place.

Touch devices and selective use

Touch devices do not show a cursor, so run these effects only when (pointer: fine) matches. Apply them to the elements you pick, such as a gallery or hero, rather than the whole site. Selective use keeps forms and long text easy to use and means the site stays fast. Plugins and custom cursor components can add multiple cursors and many settings, but one clear effect usually does more than a ton of options.

Test the effect on real hardware

Open a live demo and see it live with a mouse, a trackpad and a touch screen. Check that the default cursor is disabled only where your custom animated mouse pointer replaces it, that any label inside the cursor stays readable, and that the motion is GPU-accelerated for smooth 60fps movement. If the page also runs animated background effects, confirm they pause off screen, so the cursor does not compete with them for frames.

Why a custom cursor may feel slow

Large blur filters and shadows on a moving object are expensive. Updating top and left can also trigger layout work; a transform is the better first choice. Pause or hide the layer when the pointer leaves the page. A cursor effect cannot fix a blocked main thread, so if a page is loading heavy media, fix that first.

Explore more Scrollhaus interface effects or use the performance checklist. Implementation references: MDN pointermove and MDN pointer media query.

Frequently asked questions

Should I hide the default cursor?

Usually not. A decorative follower can add character while the familiar system cursor remains precise and visible.

Do animated cursors work on phones?

Phones have no persistent mouse pointer. Hide decorative followers on coarse-pointer devices and provide the same content through touch controls.

Why does my animated cursor feel laggy?

Large blur effects, layout-changing updates and a busy main thread are common causes. Use one transform update per animation frame and profile the page.

Browse Scrollhaus website designs and build resources →

Need help with a template, account, or project? Email admin@scrollhaus.ai.