N/A

PolaroidCard

Render a tilted photo card with app-owned image data and explicit presentation controls.

Cabin beside a lake
Weekend cabin
Desert road at sunset
Desert road at sunset
Mountain ridge above clouds
Static layout

Installation

pnpm dlx shadcn-vue@latest add "https://ui.stackhacker.io/r/polaroid-card.json"

Usage

<script setup lang="ts">
import { PolaroidCard, type PolaroidCardImage } from "@/components/polaroid-card";

const image: PolaroidCardImage = {
  src: "/images/studio-desk.jpg",
  alt: "Studio desk with open notebooks",
};
</script>

<template>
  <PolaroidCard
    :image="image"
    caption="Studio notes"
    rotation="right"
  />
</template>

App-Owned Media

PolaroidCard owns the photo-paper styling, rotation, caption rendering, and optional hover movement. Your app owns image storage, image optimization, alt text, captions, ordering, links, lightboxes, and gallery layout.

When caption is omitted, the component renders image.alt as the visible caption. Pass an explicit caption when the display label should differ from the accessible image description.

Use :interactive="false" when the card appears in a dense static layout or inside another interactive surface.

Examples

Default

Cabin beside a lake
Weekend cabin
Desert road at sunset
Desert road at sunset
Mountain ridge above clouds
Static layout

Static Card

<PolaroidCard
  :image="image"
  rotation="none"
  :interactive="false"
/>

API Reference

Props

PropTypeDefaultDescription
imagePolaroidCardImageImage source and accessible alt text supplied by your app.
captionstringimage.altOptional visible caption. Falls back to the image alt text when omitted.
rotation"left" | "right" | "none""left"Fixed card rotation for standalone placement.
interactivebooleantrueEnables hover lift, translation, scale, and straightening.
classHTMLAttributes["class"]Additional CSS classes for the root card.

Types

interface PolaroidCardImage {
  src: string;
  alt: string;
}