Skip to content
Uxelith
Prov1.0.0Cards

Image Transition

Pictures that change on the GPU: they melt, ripple, flip in tiles or part into colours, starting from the point you click or tap.

Installs with Uxelith ProHow
Licence
Pro
Packages
2
Updated
12 Nov 2026
Live

Installation

Usage

example.tsx
import { ImageTransition } from "@/components/image-transition"

const places = [
  { src: "/photos/dunes.jpg", alt: "Sand dunes at dusk", title: "Wadi Rum", caption: "Jordan" },
  { src: "/photos/fjord.jpg", alt: "Red cabins on a fjord", title: "Lofoten", caption: "Norway" },
  { src: "/photos/city.jpg", alt: "Office towers at night", title: "Shinjuku", caption: "Tokyo" },
]

export function Gallery() {
  return <ImageTransition images={places} effect="liquid" autoplay aria-label="Places" className="rounded-2xl" />
}

Props

PropTypeDefaultDescription
imagesTransitionImage[]—Each picture: src, alt, and an optional title and caption. Same origin, or served with CORS.
effect"liquid" | "ripple" | "tiles" | "prism""liquid"How one picture turns into the next.
indexnumber—The picture shown, when you control it. Pair with onIndexChange.
defaultIndexnumber0The first picture, when the component keeps its own place.
onIndexChange(index: number) => void—Called with the new picture's index.
durationnumber1400Length of one change, 600–3000 ms.
autoplaybooleanfalseMoves on by itself; waits while hovered, focused or off-screen, has a pause button, and stays still with reduced motion.
intervalnumber5000Time between pictures when autoplaying, in ms.
controlsbooleantruePrevious, next, pause and a dot per picture.
captionsbooleantrueEach picture's title and caption over its lower corner.
glowstring"var(--primary)"Colour of the light along the edge of a change. Any CSS colour.
progressnumber—Holds a change from the current picture to the next at this point, 0–1.
...propsHTMLAttributes<HTMLDivElement>—Children sit above the pictures and stay interactive; aria-label names the set.

Accessibility

  • The pictures are real img elements, so the one shown is announced with its alt text and the first paints before any script; the canvas is decorative and hidden from assistive technology.
  • It is a labelled carousel region: arrow keys, Home and End move it, and every dot is a button that names its picture and reports the current one.
  • Changes made by you are announced politely; while it plays by itself the announcements stay off, and autoplay has a pause button and waits while the pointer or focus is inside.
  • With prefers-reduced-motion a change is a short fade and nothing plays by itself.
  • Without WebGL2, on a software renderer, on a device that can't keep up, or for pictures served without CORS, pictures cross-fade instead.

Changelog

  1. v1.0.0Latest

    First release.

More in Cards

All 7 in Cards
  • CardsPro

    Card Stack

    A deck you throw cards from: the top card leans from where you grabbed it and flies off with the speed you gave it, the rest rise to take its place, and Undo brings it back. Keys and buttons too.

  • CardsPro

    Compare Slider

    Two layers split by a glass handle you drag, or that follows the pointer. A press glides the divider there on a spring, a double-click sends it home; optional feathered seam, vertical split and first-view sweep.

  • CardsPro

    Morph Card

    A card that grows into its own story: the photo, eyebrow and title fly to their places, and you pull the story down to fold it back into the grid. Built on the native modal dialog.