Perspective Marquee

Pro

A 3D tilted image grid with alternating rows scrolling infinitely in both directions.

css 3d3dmarqueeperspectiveloopscrolldepth
Perspective Marquee component preview

Overview

Perspective Marquee is a React and Tailwind CSS 3D image marquee, a tilted grid whose rows scroll forever in alternating directions, in Next.js or any React app, with no dependencies. Rows run on the same compositor keyframes as Infinite Marquee, so there is no JavaScript loop, and perspective, X and Z tilt, card size, gap, and speed are props. Pause every row on hover, fade the edges, or draw dashed grid lines in the gutters, and reduced motion stops the rows. Use landscape images, since every card is cropped to the same fixed width and height.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add perspective-marquee

Usage

Import PerspectiveMarquee from @/components/wensity/perspective-marquee and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
"use client";
import { PerspectiveMarquee } from "@/components/wensity/perspective-marquee";
const images = [
{ src: "https://assets.wensity.com/photos/landscape/eiffel-tower-sunset.webp", alt: "Eiffel Tower" },
{ src: "https://assets.wensity.com/photos/landscape/rainforest-falls.webp", alt: "Rainforest falls" },
{ src: "https://assets.wensity.com/photos/landscape/dune-sunset.webp", alt: "Dune sunset" },
{ src: "https://assets.wensity.com/photos/landscape/alpine-lake-reflection.webp", alt: "Alpine lake" },
];
export function PerspectiveMarqueeDemo() {
return (
<PerspectiveMarquee
images={images}
rows={4}
speed={40}
rotateX={18}
rotateZ={-22}
className="h-[520px]"
/>
);
}

Props

PropTypeDefaultDescription
imagesPerspectiveMarqueeImage[]-Landscape images distributed across rows.
rowsnumber4Number of horizontal marquee rows.
imagesPerRownumber6Images per row before the seamless duplicate.
speednumber40Base cycle duration in seconds. Lower is faster.
gapnumber24Gap between cards in pixels.
cardWidthnumber280Card width in pixels.
cardHeightnumber158Card height in pixels.
perspectivenumber1000CSS perspective distance in pixels.
rotateXnumber183D tilt around X in degrees.
rotateZnumber-223D tilt around Z in degrees.
pauseOnHoverbooleanfalsePause every row while the cursor is over the stage.
fadeEdgesbooleanfalseSoft edge fades only, with no center vignette.
showLinesbooleantrueDashed grid lines in the blank gutters between cards.

Featured in React 3D components and React carousel components.