Skip to content
VenusUI
Get started

Polaroid Stack

A stack of instant photos you drag or swipe through; each one develops as it reaches the top.

Preview

Installation

npx shadcn@latest add @venusui/polaroid-stack

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/polaroid-stack.tsx

Usage

The code behind the preview above.

polaroid-stack-demo.tsx

import { PolaroidStack } from "@/components/ui/polaroid-stack"

// Photos: Unsplash (free under the Unsplash License).
const photo = (id: string) => `https://images.unsplash.com/photo-${id}?w=600&h=600&fit=crop&auto=format&q=80`

export default function PolaroidStackDemo() {
  return (
    <PolaroidStack
      className="w-[min(18rem,calc(100vw-4rem))]"
      photos={[
        { src: photo("1493976040374-85c8e12f0c0e"), alt: "A pagoda at the end of an old street in Kyoto at dusk", caption: "Kyoto, golden hour" },
        { src: photo("1476610182048-b716b8518aae"), alt: "A waterfall over green cliffs at sunset", caption: "chasing waterfalls" },
        { src: photo("1490806843957-31f4c9a91c65"), alt: "Mount Fuji framed by cherry blossoms", caption: "Fuji finally showed up!" },
        { src: photo("1531366936337-7c912a4589a7"), alt: "Green and purple northern lights over snow", caption: "2 am, worth it" },
        { src: photo("1501785888041-af3ef285b470"), alt: "Rowing boats on a turquoise lake below mountains", caption: "lake day" },
      ]}
    />
  )
}

API reference

PropTypeDefaultDescription
photos{ src: string; alt: string; caption?: string }[]—Photos, top first. Captions are written in a handwriting-style font.

All <div> props; className sets the width (the stack is 4:5).

Requirements

  • lucide-react for the arrow icon. React 19 and Tailwind CSS v4. The CLI adds the polaroid-develop keyframes and --animate-polaroid-develop.

Customization

  • Captions use system handwriting fonts (Segoe Print, Bradley Hand, Marker Felt) with a cursive fallback. Load a web font and change HANDWRITING for the same look everywhere.

Accessibility

  • The stack is focusable and the arrow keys show the next photo; the “Next photo” button does the same.
  • Only the top photo is exposed to screen readers, and changes are announced with its caption and description.
  • With reduced motion photos don't develop or fly off.

Troubleshooting

Swiping on a phone scrolls the page.
The stack only captures sideways drags (touch-pan-y); swipe left or right, or use the button.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

A card that tilts in 3D toward the pointer with spring physics.

Loading preview

A flight boarding pass with a perforated stub and code that flips to the fare and baggage details.

Loading preview

Stacked cards with the next ones peeking out; Next sends the top card to the back.