# ImageTrailCursor

> 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).

- Package: `fancy-ui-vue` (Vue 3.5+ + Tailwind CSS v4)
- Category: Effects
- Tags: cursor, animation, images, trail, interactive
- Types: `ImageTrailCursorProps`, `VariantType`
- Docs: https://fancy-ui.rama.app/docs/components/image-trail-cursor
- Source: https://github.com/RamaHerbin/fancy-ui/tree/main/vue/src/components/image-trail-cursor

## Import

```vue
<script setup lang="ts">
import { ImageTrailCursor } from 'fancy-ui-vue';
</script>
```

Setup (once per project): `npm install fancy-ui-vue`, then put these lines in your main CSS file (the stylesheet imports go right after `@import "tailwindcss";`):

```css
@import "tailwindcss";
@import "fancy-ui-vue/tailwind.css";
@import "fancy-ui-vue/styles.css";
```

Full guide: https://fancy-ui.rama.app/llms.txt

The names below are the ones to write in a Vue template; when one differs from the Svelte name, the Svelte name follows in parentheses. Snippets become named slots (`#default` is the default snippet), a prop the Vue port declares as a model is a `v-model:<name>` (except `ref`, exposed via `defineExpose({ ref })`: put a template ref on the component and read `.ref`) and callbacks are listeners (`onclick` is `@click`). Every component sets `inheritAttrs: false`: `class` is a declared prop, merged where the Svelte component applies it (not always the root element), and only when the props table below lists it; other attributes do not fall through unless the package README lists the component as forwarding native attributes. Divergences: https://github.com/RamaHerbin/fancy-ui/tree/main/vue#divergences-from-the-svelte-api

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `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 |

## Example

```vue
<script setup lang="ts">
import { ref } from "vue";
import { ImageTrailCursor, type VariantType } from "fancy-ui-vue";

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",
];

const variants: { type: VariantType; label: string }[] = [
	{ type: "type1", label: "Fade & Scale" },
	{ type: "type3", label: "Float-up" },
	{ type: "type5", label: "Rotation" },
];

const variant = ref<VariantType>("type1");
</script>

<template>
	<div class="w-full">
		<div class="mb-4 flex flex-wrap gap-2">
			<button
				v-for="v in variants"
				:key="v.type"
				type="button"
				class="rounded-lg border px-3 py-1.5 text-sm"
				:aria-pressed="variant === v.type"
				@click="variant = v.type"
			>
				{{ v.label }}
			</button>
		</div>
		<div class="relative h-[500px] cursor-crosshair overflow-hidden rounded-lg border">
			<ImageTrailCursor :images="images" :variant="variant" />
			<div class="pointer-events-none absolute inset-0 flex items-center justify-center">
				<p class="text-lg font-medium select-none">Move your cursor here</p>
			</div>
		</div>
	</div>
</template>
```
