Skip to content
Effects Fancy Stable

ImageTrailCursor

.md

Trail of images that spawn and animate along the cursor's path, powered by GSAP timelines, with 18 selectable variants: fades, momentum drift, rotation flings, 3D perspective tilt, a hard-edge pixelated snap, a bouncy scale pop, images that fall or bounce under gravity, a flame flicker, and five fragment reveals (venetian, curtain, hexagon, liquid, zoom split)

Available for Svelte 5, React, and Vue 3.

Preview

Installation

pnpm add fancy-ui-svelte
import { ImageTrailCursor } from "fancy-ui-svelte";

Usage

svelte
<script lang="ts">
	import { ImageTrailCursor } from "fancy-ui-svelte";
	import type { VariantType } from "fancy-ui-svelte";

	const images = [
		"https://picsum.photos/seed/trail1/400/440",
		"https://picsum.photos/seed/trail2/400/440",
		"https://picsum.photos/seed/trail3/400/440",
		"https://picsum.photos/seed/trail4/400/440",
		"https://picsum.photos/seed/trail5/400/440",
		"https://picsum.photos/seed/trail6/400/440",
		"https://picsum.photos/seed/trail7/400/440",
		"https://picsum.photos/seed/trail8/400/440",
	];

	const variants: { type: VariantType; label: string }[] = [
		{ type: "type1", label: "Fade & Scale" },
		{ type: "type2", label: "Brightness" },
		{ type: "type3", label: "Float-up" },
		{ type: "type4", label: "Momentum" },
		{ type: "type5", label: "Rotation" },
		{ type: "type6", label: "Speed-reactive" },
		{ type: "type7", label: "Stacking" },
		{ type: "type8", label: "3D Perspective" },
		{ type: "pixelated", label: "Pixelated" },
		{ type: "scale", label: "Scale" },
		{ type: "fall", label: "Image fall" },
		{ type: "gravity", label: "Gravity" },
		{ type: "flame", label: "Flame" },
		{ type: "venetian", label: "Venetian" },
		{ type: "curtain", label: "Curtain" },
		{ type: "hexagon", label: "Hexagon" },
		{ type: "liquid", label: "Liquid" },
		{ type: "zoom-split", label: "Zoom split" },
	];

	let selectedVariant: VariantType = $state("type1");
</script>

<div class="w-full">
	<div class="mb-4 flex flex-wrap gap-2">
		{#each variants as v}
			<button
				class="rounded-lg border px-3 py-1.5 text-sm transition-colors {selectedVariant === v.type
					? 'border-primary bg-primary text-primary-foreground'
					: 'border-border bg-card hover:bg-accent'}"
				onclick={() => (selectedVariant = v.type)}
			>
				{v.label}
			</button>
		{/each}
	</div>
	<div class="relative h-[500px] cursor-crosshair overflow-hidden rounded-lg border">
		<ImageTrailCursor {images} variant={selectedVariant} />
		<div class="pointer-events-none absolute inset-0 flex items-center justify-center">
			<p class="text-muted-foreground text-lg font-medium select-none">Move your cursor here</p>
		</div>
	</div>
</div>

Examples

Basic Usage

Animation Variants

18 trail animation styles: fades and drifts, a pixelated snap, scale/fall/gravity/flame, and five fragment reveals.

Props

PropTypeDefaultDescription
images string[][]Array of image URLs to show in the trail
variant "type1" | ... | "type8" | "pixelated" | "scale" | "fall" | "gravity" | "flame" | "venetian" | "curtain" | "hexagon" | "liquid" | "zoom-split""type1"Animation variant controlling how images appear and move (see the README for what each one does)
class string""Additional CSS classes for the container