Kinetic UI
Back to Introduction
Mouse Interactions

Hover Image Trails

A stunning visual effect that spawns a trail of images following the cursor — with 5 animation styles.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add hover-image-trails

When the user moves their mouse across a designated canvas, a trail of images rapidly pops up and fades away following the cursor path. This effect is extremely popular on high-end photography portfolios and creative agency websites. Now with 5 animation effects and performance-capped trails.

Live Preview

Hover Image Trails

Portfolio Gallery

Move your cursor to reveal images

Pop:Classic scale-in burst — images pop up at full size and gracefully fade out.

Installation

npx kinetic-ui-cli@latest add hover-image-trails

Props

Effects

| Effect | Animation | Feel | |---|---|---| | pop | Scale burst in/out | Classic, snappy | | rotate | Direction-aware random rotation | Organic, playful | | stretch | Horizontal squeeze → settle | Elastic, dynamic | | glitch | Clip-path wipe reveal | Digital, edgy | | wave | Spring-based upward float | Dreamy, buoyant |

How It Works

The component tracks cursor position via onPointerMove. When the distance from the last spawn exceeds distanceThreshold, it calculates the movement angle and velocity, then spawns a new trail image at that position. Each effect uses these physics values for direction-aware animations. A maxTrails cap ensures DOM node count stays bounded. Images auto-remove after fadeDuration via setTimeout.

Usage Guide

1. Import the Component

Import the component into your React or Next.js page:

import { HoverImageTrails } from "@/components/creative/hover-image-trails";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { HoverImageTrails } from "@/components/creative/hover-image-trails";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <HoverImageTrails
      >
        <div>Content goes here</div>
      </HoverImageTrails>
    </div>
  );
}
Performance Notes
  • Uses CSS hardware acceleration via GPU transform-binds.
  • Damped interpolation minimizes paint-redraw flashes.
  • Tree-shakable import: only compiles elements requested.
Accessibility Notes
  • Full keyboard focus-ring navigation support (`Tab`/`Shift+Tab`).
  • ARIA roles mapped correctly for assistive screen readers.
  • Respects `prefers-reduced-motion` system toggles.