Overview
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
Static Card
<PolaroidCard
:image="image"
rotation="none"
:interactive="false"
/>API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
image | PolaroidCardImage | — | Image source and accessible alt text supplied by your app. |
caption | string | image.alt | Optional visible caption. Falls back to the image alt text when omitted. |
rotation | "left" | "right" | "none" | "left" | Fixed card rotation for standalone placement. |
interactive | boolean | true | Enables hover lift, translation, scale, and straightening. |
class | HTMLAttributes["class"] | — | Additional CSS classes for the root card. |
Types
interface PolaroidCardImage {
src: string;
alt: string;
}
