Product patina compare — Storefront block

Pro

storefront-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-compare

Usage

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.

PropTypeDescription
headingstringWordswhat these pictures are ("Your photos, your words")
leadstringWordsone sentence of context, with the permission note if useful
itemsItem[]the items shown, in order
thenNow*ThenNowthen-now: two real pictures of the same product, new and worn, with the owner’s own table
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Item items[] · 9 props
PropTypeDescription
imagestringPicturethe customer’s own photo or the video’s poster, shared with their permission
altstringWordswhat the picture shows
textstringWordsthe caption or the post, word for word
author*stringWordsthe handle or name of who posted it ("@marie.ateliers")
date*stringWordswhen it was posted, as written ("14 March 2025")
sourcestringWordswhere it was posted ("Instagram")
ratingnumberthe stars the customer gave, when it is a review
durationstringWordsvideo-row: the length of the video ("0:48")
urlstringDesignthe address of the original post (https://…)
ThenNow thenNow · 6 props
PropTypeDescription
before*Beforethe picture when new
after*Afterthe picture now
beforeLabelstringWordswhat the first picture is ("At purchase")
afterLabelstringWordswhat the second picture is ("After two years")
partsPart[]the parts that change with time, each with a note
authorstringWordswho owns the product
Before thenNow.before · 2 props
PropTypeDescription
image*stringPicturea picture: a root-relative path (/media/…) or an absolute URL
alt*stringWordswhat the picture shows
After thenNow.after · 2 props
PropTypeDescription
image*stringPicturea picture: a root-relative path (/media/…) or an absolute URL
alt*stringWordswhat the picture shows
Part thenNow.parts[] · 3 props
PropTypeDescription
part*stringWordsthe part of the product ("Handle", "Leather")
before*stringWordsits state when it was bought
after*stringWordsits state after use
Options options · 1 props
PropTypeDescription
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa 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).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
asseta picture’s address as your app serves it
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour 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:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo 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.

All 409 storefront blocks