LayerwiseLayerwise
  • Features
  • Pricing
  • Templates
  • Docs
DownloadDownload
FeaturesPricingTemplatesDocsAI Website BuilderVibe CodingPersonal Software
DownloadDownload
  1. Glossary
  2. /
  3. Interaction feedback

Custom cursor

Also called cursor follower or animated cursor

A designed shape, such as a dot or a ring, that replaces or trails the mouse pointer and reacts to what it passes over.

import { useState, type ReactNode } from 'react';
import {
  motion,
  useMotionValue,
  useReducedMotion,
  useSpring
} from 'motion/react';

const RING_SPRING = { stiffness: 300, damping: 28 };

type CursorState = 'hidden' | 'default' | 'hover';

export function CustomCursor({ children }: { children: ReactNode }) {
  const x = useMotionValue(0);
  const y = useMotionValue(0);
  const ringX = useSpring(x, RING_SPRING);
  const ringY = useSpring(y, RING_SPRING);
  const reduceMotion = useReducedMotion();
  const [state, setState] = useState<CursorState>('hidden');

  return (
    <div
      onPointerMove={(event) => {
        if (event.pointerType !== 'mouse') return;
        x.set(event.clientX);
        y.set(event.clientY);
        const target = event.target as Element;
        // Text fields keep the normal I-beam cursor.
        if (target.closest('input, textarea')) setState('hidden');
        else setState(target.closest('a, button') ? 'hover' : 'default');
      }}
      onPointerLeave={() => setState('hidden')}
      className='pointer-fine:cursor-none pointer-fine:[&_*]:cursor-none pointer-fine:[&_input,&_textarea]:cursor-text'
    >
      {children}
      <div
        aria-hidden
        className='pointer-events-none fixed inset-0 z-50 hidden pointer-fine:block'
      >
        {/* The dot tracks the pointer exactly; only the ring trails. */}
        <motion.div
          style={{ x, y }}
          animate={{ opacity: state === 'default' ? 1 : 0 }}
          className='absolute -top-1 -left-1 size-2 rounded-full bg-foreground'
        />
        <motion.div
          style={{ x: reduceMotion ? x : ringX, y: reduceMotion ? y : ringY }}
          animate={{
            opacity: state === 'hidden' ? 0 : 1,
            scale: state === 'hover' ? 1.8 : 1
          }}
          className='absolute -top-4 -left-4 size-8 rounded-full border border-foreground/60'
        />
      </div>
    </div>
  );
}
Add a custom cursor for mouse users only (pointer: fine): hide the system cursor and draw an 8px dot that follows the mouse exactly plus a 32px ring that follows it with a spring (stiffness 300, damping 28). Over links and buttons, scale the ring to 1.8 and hide the dot. Keep the normal cursor in text inputs, and make the ring follow without lag when prefers-reduced-motion is set.

Paste into Layerwise or any AI coding tool.

What is Custom cursor?

A custom cursor hides the system arrow, or adds to it, and draws your own shape at the pointer position. A popular version pairs a small dot that tracks the mouse exactly with a larger ring that trails behind it with a little lag, then grows when it passes over a link or button.

It shows up on portfolios, agency sites, and creative landing pages, where personality matters more than speed. On product interfaces and long reading pages it usually gets in the way.

Keep the real pointer position exact: the dot should never lag, or clicking feels off. Enable it only for a mouse with @media (pointer: fine), keep the normal text cursor in inputs, and drop the trailing motion for people who prefer reduced motion. If you only want a different icon, CSS can do it alone with cursor: url(cursor.svg) 4 4, auto.

Often confused with

Magnetic button
A magnetic button moves the element toward the pointer. A custom cursor changes the pointer itself.

Related terms

All terms

Magnetic button

A button that leans toward the mouse pointer as it gets close, then springs back when the pointer leaves.

Hover effect

A visual change, such as a lift, glow, or zoom, that happens when the mouse pointer moves over an element to show it can be clicked.

Spring animation

An animation driven by simulated spring physics in place of a fixed duration and curve, so motion can overshoot, settle, and react naturally.

Reduced motion

An operating system setting that asks apps to minimize movement, which websites detect with the prefers-reduced-motion media query.

Build it with Layerwise

Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.

DownloadDownloadRead the docs
LayerwiseLayerwise

Build full-stack web apps in minutes with AI.

Product

  • Features
  • Pricing
  • Download
  • Templates

Solutions

  • AI Website Builder
  • Vibe Coding
  • Personal Software

Resources

  • Documentation
  • Changelog
  • Blog
  • Vibe Coding Glossary
  • llms.txt
  • llms-full.txt

Company

  • About
  • Contact

Legal

  • Privacy
  • Analytics Privacy
  • Terms
  • Security
  • Abuse

© 2026 Layerwise. All rights reserved.

Entrances & exits

  • Fade in
  • Slide in
  • Scale in
  • Pop in
  • Blur in
  • Reveal animation
  • Enter and exit animations

Timing & sequencing

  • Duration
  • Delay
  • Keyframes
  • Tweening
  • Stagger
  • Orchestration
  • Fill mode
  • Stepped animation
  • Looping animation
  • Yoyo animation

Easing

  • Easing
  • Linear easing
  • Ease-in
  • Ease-out
  • Ease-in-out
  • Cubic-bezier
  • Asymmetric easing
  • Overshoot easing

Springs & physics

  • Spring animation
  • Stiffness
  • Damping
  • Mass
  • Bounce
  • Velocity
  • Momentum
  • Interruptible animation
  • Rubber-banding

Transforms

  • Translate
  • Scale
  • Rotate
  • Skew
  • 3D flip
  • Perspective
  • Transform origin
  • Origin-aware animation

State transitions

  • Crossfade
  • Morph
  • Shared element transition
  • Layout animation
  • Height auto animation
  • Direction-aware transition
  • Continuity transition
  • Page transition
  • View Transitions API

Scroll effects

  • Scroll reveal
  • Scroll-driven animation
  • Parallax scrolling
  • Scrollytelling
  • Scroll pinning
  • Horizontal scroll section
  • Scroll progress bar
  • Scroll snap
  • Smooth scrolling

Interaction feedback

  • Hover effect
  • Press feedback
  • Ripple effect
  • Shake animation
  • Hold to confirm
  • Drag gesture
  • Drag to reorder
  • Swipe to dismiss
  • Pull to refresh
  • Magnetic button
  • Custom cursor
  • 3D tilt card
  • Spotlight card

Text effects

  • Typewriter effect
  • Text scramble
  • Split text animation
  • Text morph
  • Rotating words
  • Gradient text
  • Shimmer text
  • Number ticker
  • Tabular numbers
  • Underline animation

Loops & ambient motion

  • Marquee
  • Pulse animation
  • Float animation
  • Orbit animation
  • Idle animation
  • Particle background
  • Border beam
  • Confetti
  • Animated gradient

Visual effects

  • Blur
  • Clip-path
  • Mask
  • Before/after slider
  • SVG line drawing
  • Lottie animation

Motion principles

  • Purposeful animation
  • Anticipation
  • Follow-through
  • Squash and stretch
  • Perceived performance
  • Frequency of use
  • Spatial consistency
  • Reduced motion

Animation performance

  • Frame rate (FPS)
  • Jank
  • GPU acceleration
  • will-change
  • Layout thrashing

Layout

  • Hero section
  • Above the fold
  • Sticky header
  • Sidebar
  • Bento grid
  • Card
  • Flexbox
  • CSS Grid
  • Padding vs margin
  • Responsive design
  • Container
  • Masonry layout
  • Split screen
  • Z-index
  • Overflow

Components

  • Button variants
  • Modal
  • Drawer
  • Popover
  • Tooltip
  • Dropdown menu
  • Context menu
  • Toast notification
  • Tabs
  • Segmented control
  • Accordion
  • Carousel
  • Command palette
  • Combobox
  • Toggle switch
  • Checkbox
  • Radio button
  • Date picker
  • Breadcrumb
  • Pagination
  • Infinite scroll
  • Badge
  • Avatar stack
  • Empty state
  • Skeleton screen
  • Spinner
  • Progress bar
  • Data table
  • Stepper
  • Floating label
  • Inline validation
  • Alert banner
  • Tag input

States & patterns

  • Interaction states
  • Focus ring
  • Loading state
  • Optimistic UI
  • Debounce
  • Lazy loading
  • Dark mode
  • Micro-interaction
  • Affordance
  • Undo
  • Drag and drop
  • Keyboard shortcut

Visual styles

  • Glassmorphism
  • Liquid glass
  • Neumorphism
  • Claymorphism
  • Neo-brutalism
  • Skeuomorphism
  • Flat design
  • Mesh gradient
  • Aurora background
  • Grain texture
  • Glow effect
  • Drop shadow
  • Border radius
  • Grid background
  • Typographic hierarchy
  • Accent color
  • Color contrast

Vibe coding & AI

  • Vibe coding
  • Prompt
  • Context window
  • Token
  • AI agent
  • Tool call
  • Hallucination
  • Diff
  • Live preview
  • Checkpoint
  • Git commit
  • Deploy
  • Frontend and backend
  • API
  • Database
  • Rules file
  • MCP
  • Plan mode
  • Visual edit
Nimbus

We design calm software.