Move across the area and tiles pop up along the path, then fade away. Fill each with a colour or a project name; made for the top of a portfolio or a big Selected work heading.
How to use
Make two files in your project's components folder: image-trail.tsx and image-trail.module.css.
Paste the code into each one, keeping the licence note at the top of the component.
It needs nothing beyond React. Your project needs CSS Modules, which Next.js and Vite already have.
Import it where you want it, then change the words, colours and sizes to yours.
The code
"use client";
import React, { type ElementType, type HTMLAttributes, useEffect, useMemo, useRef } from "react";
import styles from "./image-trail.module.css";
/** The properties an item can animate as it appears and leaves. */
export type TrailProperty = "opacity" | "scale" | "rotate" | "filter";
/** Timing in seconds. `times` places each keyframe between 0 and 1; `ease` is a CSS easing or easeIn, easeOut, easeInOut, linear. */
export type TrailTiming = { duration?: number; times?: number[]; ease?: string };
interface TileTrailProps extends HTMLAttributes<HTMLElement> {
This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.
"use client";
import React, { type ElementType, type HTMLAttributes, useEffect, useMemo, useRef } from "react";
import styles from "./image-trail.module.css";
/** The properties an item can animate as it appears and leaves. */
export type TrailProperty = "opacity" | "scale" | "rotate" | "filter";
/** Timing in seconds. `times` places each keyframe between 0 and 1; `ease` is a CSS easing or easeIn, easeOut, easeInOut, linear. */
export type TrailTiming = { duration?: number; times?: number[]; ease?: string };
interface TileTrailProps extends HTMLAttributes<HTMLElement> {
This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.