Perspective Marquee
ProA 3D tilted image grid with alternating rows scrolling infinitely in both directions.
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
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.
"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 (<PerspectiveMarqueeimages={images}rows={4}speed={40}rotateX={18}rotateZ={-22}className="h-[520px]"/>);}
Props
| Prop | Type | Default | Description |
|---|---|---|---|
images | PerspectiveMarqueeImage[] | - | Landscape images distributed across rows. |
rows | number | 4 | Number of horizontal marquee rows. |
imagesPerRow | number | 6 | Images per row before the seamless duplicate. |
speed | number | 40 | Base cycle duration in seconds. Lower is faster. |
gap | number | 24 | Gap between cards in pixels. |
cardWidth | number | 280 | Card width in pixels. |
cardHeight | number | 158 | Card height in pixels. |
perspective | number | 1000 | CSS perspective distance in pixels. |
rotateX | number | 18 | 3D tilt around X in degrees. |
rotateZ | number | -22 | 3D tilt around Z in degrees. |
pauseOnHover | boolean | false | Pause every row while the cursor is over the stage. |
fadeEdges | boolean | false | Soft edge fades only, with no center vignette. |
showLines | boolean | true | Dashed grid lines in the blank gutters between cards. |
Featured in React 3D components and React carousel components.
