Card Stack Carousel

Pro

A React card stack carousel on Framer Motion: each photo drops out below the pile, slips behind it and rises to the back.

carouselstackcardsphotodepth
Card Stack Carousel component preview

Overview

Card Stack Carousel is a React and Tailwind CSS stacked card carousel that flips through a loose pile of photo prints, in Next.js or any React app, built on Framer Motion. On next, the top print drops out below the pile, slips behind it once it is fully clear, and rises into the back slot while the rest shuffle forward. Previous runs the same path in reverse. Autoplay waits for your delay and rests while the stack is off screen or the tab is hidden. Arrow keys work once the stack has focus, and reduced motion swaps prints instantly.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add stack-reveal

Usage

Import StackReveal from @/components/wensity/stack-reveal 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
import {
StackReveal,
type StackRevealCard,
} from "@/components/wensity/stack-reveal";
const photo = (name: string) =>
`https://assets.wensity.com/photos/architecture-interiors/${name}.webp`;
const cards: StackRevealCard[] = [
{
id: "pool-villa",
src: photo("mediterranean-pool-villa"),
alt: "White villa with an olive tree beside a pool above the sea",
label: "Pool villa",
},
{
id: "forest-glass-house",
src: photo("forest-glass-house"),
alt: "Glass house lit from inside in a misty pine forest",
label: "Forest glass house",
},
{
id: "desert-house",
src: photo("desert-concrete-house"),
alt: "Low concrete house in the desert at sunset",
label: "Desert house",
},
{
id: "night-pavilion",
src: photo("night-glass-pavilion"),
alt: "Long glass pavilion glowing over still water at night",
label: "Night pavilion",
},
{
id: "water-courtyard",
src: photo("concrete-water-courtyard"),
alt: "Concrete courtyard with a bonsai on a pool of still water",
label: "Water courtyard",
},
];
export default function Example() {
return (
<StackReveal
cards={cards}
width={520}
height={330}
delay={5000}
title="Houses that hold the light"
description="A pile of prints from five quiet houses. Flip through them, and each one tucks back under the stack."
/>
);
}

Props

PropTypeDefaultDescription
cardsStackRevealCard[]Houses setPhoto prints in the pile. Each takes src, alt, label and objectPosition.
titlestring"Houses that hold the light"Headline shown beside the pile.
descriptionstring-Supporting copy under the title.
widthnumber520Width of each print, in px. The pile scales down to fit narrower columns.
heightnumber330Height of each print, in px.
cardDistancenumber56How far back prints spread to the sides, in px.
verticalDistancenumber62How far back prints peek above the top one, in px.
skewAmountnumber6Tilt of the prints in the pile, in degrees.
delaynumber5000Time between automatic moves, in ms.
autoplaybooleantrueMoves to the next print on a timer. Rests while off screen or the tab is hidden.
pauseOnHoverbooleanfalseOptional. Pauses autoplay while the cursor is over the component.
controlsbooleantrueShows the previous and next buttons, counter and caption.
easing"elastic" | "linear""elastic"Motion of the pile. elastic = spring with no overshoot; linear = eased glide.
dropDistancenumberMeasuredHow far below the pile the moving print drops, in px. Measured from the card size by default.
onCardClick(idx: number) => void-Fires when a print is clicked.
  • Split-Flap Display component preview

    Split-Flap Display

    A ceramic and graphite split-flap device that ripples each flap into your message.

  • Interactive 3D Globe component preview

    Interactive 3D Globe

    A 3D Earth lit day and night from the real sun position, wrapped in a soft atmosphere, with smooth drag-to-orbit controls.

  • Animated Code Diff Viewer component preview

    Animated Code Diff Viewer

    Inline or toggled code diffs rendered inside the same polished code block frame, flipping between before and after.

  • Animated Terminal component preview

    Animated Terminal

    A terminal UI with self-typing commands, CRT phosphor glow and scanlines, streaming output that never re-renders a line.

Featured in React carousel components.