Product patina compare — Storefront block
Prostorefront-product-patina-compare · for home, product pages
Product patina compare
Two pictures of the same product, new and worn, split by a handle, with a part-by-part table: durability told by its owner; the merchant’s own only.
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/storefront-product-patina-compareUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontProductPatinaCompare from '@/components/trame/blocks/storefront/storefront-product-patina-compare.vue'
const props = {
heading: "New, then two years later",
lead: "Shared with their authors’ permission.",
thenNow: {
before: {
image: "https://images.unsplash.com/photo-1657603738389-951c374b740c?w=1600&q=80",
alt: "A cognac leather shoulder bag on a light background"
},
after: {
image: "https://images.unsplash.com/photo-1473188588951-666fce8e7c68?w=1600&q=80",
alt: "A patinated brown leather satchel resting on a stone block"
},
beforeLabel: "When bought",
afterLabel: "After two years",
author: "Photos by Marie, a customer since 2023",
parts: [
{
part: "Leather",
before: "Light, matte",
after: "Darker, with a patina"
},
{
part: "Handles",
before: "Stiff",
after: "Supple, intact"
}
]
}
}
</script>
<template>
<StorefrontProductPatinaCompare v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| heading | string | Wordswhat these pictures are ("Your photos, your words") |
| lead | string | Wordsone sentence of context, with the permission note if useful |
| items | Item[] | the items shown, in order |
| thenNow* | ThenNow | then-now: two real pictures of the same product, new and worn, with the owner’s own table |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Item items[] · 9 props
| Prop | Type | Description |
|---|---|---|
| image | string | Picturethe customer’s own photo or the video’s poster, shared with their permission |
| alt | string | Wordswhat the picture shows |
| text | string | Wordsthe caption or the post, word for word |
| author* | string | Wordsthe handle or name of who posted it ("@marie.ateliers") |
| date* | string | Wordswhen it was posted, as written ("14 March 2025") |
| source | string | Wordswhere it was posted ("Instagram") |
| rating | number | the stars the customer gave, when it is a review |
| duration | string | Wordsvideo-row: the length of the video ("0:48") |
| url | string | Designthe address of the original post (https://…) |
ThenNow thenNow · 6 props
| Prop | Type | Description |
|---|---|---|
| before* | Before | the picture when new |
| after* | After | the picture now |
| beforeLabel | string | Wordswhat the first picture is ("At purchase") |
| afterLabel | string | Wordswhat the second picture is ("After two years") |
| parts | Part[] | the parts that change with time, each with a note |
| author | string | Wordswho owns the product |
Before thenNow.before · 2 props
| Prop | Type | Description |
|---|---|---|
| image* | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt* | string | Wordswhat the picture shows |
After thenNow.after · 2 props
| Prop | Type | Description |
|---|---|---|
| image* | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt* | string | Wordswhat the picture shows |
Part thenNow.parts[] · 3 props
| Prop | Type | Description |
|---|---|---|
| part* | string | Wordsthe part of the product ("Handle", "Leather") |
| before* | string | Wordsits state when it was bought |
| after* | string | Wordsits state after use |
Options options · 1 props
| Prop | Type | Description |
|---|---|---|
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| asset | a picture’s address as your app serves it |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- Subtle motion: one short reveal; still under reduced motion
- Real buttons and links, a visible focus
A storefront section, for home, product pages; it uses @lucide/vue, @vueuse/core, clsx, motion, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More storefront blocks
- Product overview mosaic: one lead picture and the others as a two-column grid under it, the buy box beside: a product with 3 to 7 pictures of equal interest (a bag, a jacket).
- Product overview poster panel: the first picture as a wide panel carrying the product’s one-line summary, its story and three of its highlights, a narrow buy box beside it and the other facts in a band under both: a single-product shop or a hero product whose page should read like a landing.
- Product overview split: the gallery with its thumbnails beside a buy box: the default for any product with a few pictures.
- Product overview stacked: every picture in full, one under the other, beside a buy box that stays in view (a carousel on a phone): fashion and objects with many photographs, where the pictures sell.
- Product profile scale bars: Labelled scales with a precise marker for roast, body or intensity; the merchant’s own only.
- Product Q&A question index: Every question first as a numbered index of links, then each answer open under its number: a long list of questions a shopper scans before reading; the merchant's own questions only.
- Product Q&A section: A heading beside two columns of answers for a full product section; the merchant's own questions only.
- Product Q&A under buy box: Compact open disclosures for the buy column; the merchant's own questions and answers only.