diff --git a/app/components/demo/PolaroidCardDemo.vue b/app/components/demo/PolaroidCardDemo.vue new file mode 100644 index 0000000..b7f53a5 --- /dev/null +++ b/app/components/demo/PolaroidCardDemo.vue @@ -0,0 +1,50 @@ + + + diff --git a/app/registry/blocks/polaroid-card/PolaroidCard.vue b/app/registry/blocks/polaroid-card/PolaroidCard.vue new file mode 100644 index 0000000..53849d0 --- /dev/null +++ b/app/registry/blocks/polaroid-card/PolaroidCard.vue @@ -0,0 +1,66 @@ + + + diff --git a/app/registry/blocks/polaroid-card/index.ts b/app/registry/blocks/polaroid-card/index.ts new file mode 100644 index 0000000..d3ab3e4 --- /dev/null +++ b/app/registry/blocks/polaroid-card/index.ts @@ -0,0 +1 @@ +export { default as PolaroidCard, type PolaroidCardImage, type PolaroidCardProps } from "./PolaroidCard.vue"; diff --git a/content/docs/2.components/10.polaroid-card.md b/content/docs/2.components/10.polaroid-card.md new file mode 100644 index 0000000..b2c0acd --- /dev/null +++ b/content/docs/2.components/10.polaroid-card.md @@ -0,0 +1,87 @@ +--- +title: PolaroidCard +description: Render a tilted photo card with app-owned image data and explicit presentation controls. +category: content +--- + +::component-preview +--- +name: PolaroidCardDemo +--- +:: + +## Installation + +```bash +npx shadcn-vue@latest add "https://ui.stackhacker.io/r/polaroid-card.json" +``` + +## Usage + +```vue + + + +``` + +## 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 + +::component-preview +--- +name: PolaroidCardDemo +--- +:: + +### Static Card + +```vue + +``` + +## 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 + +```ts +interface PolaroidCardImage { + src: string; + alt: string; +} +``` diff --git a/scripts/registry-verify.ts b/scripts/registry-verify.ts index 0b39d7c..6ffba00 100644 --- a/scripts/registry-verify.ts +++ b/scripts/registry-verify.ts @@ -99,6 +99,10 @@ const expectedItems: Record = { dependencies: [], registryDependencies: [], }, + "polaroid-card": { + dependencies: [], + registryDependencies: [], + }, "docs-pager": { dependencies: ["@lucide/vue"], registryDependencies: [],