Product results pair tabs — Storefront block
Freestorefront-product-results-pair-tabs · for product, landing pages
Product results pair tabs
A product whose results are measured (a care, a treatment): one tab per result, its before-after pair, its figure and an expert’s word
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-results-pair-tabsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontProductResultsPairTabs from '@/components/trame/blocks/storefront/storefront-product-results-pair-tabs.vue'
const props = {
eyebrow: "Why this bag",
title: "Made to last, designed to be repaired",
tabs: [
{
label: "Patina",
before: "https://images.unsplash.com/photo-1755543041980-276589f8323c?w=1600&q=80",
after: "https://images.unsplash.com/photo-1778882996728-952ed23dc6f4?w=1600&q=80",
stat: "Patina noticed by 9 out of 10 customers after three months of daily use (40 people followed)"
},
{
label: "Luster",
before: "https://images.unsplash.com/photo-1755541608110-3440a0f168ed?w=1600&q=80",
after: "https://images.unsplash.com/photo-1787243293233-92f3188cde4b?w=1600&q=80",
stat: "Leather conditioned twice a year: depth of color rated 4.6/5 by the same panel"
}
],
expert: {
name: "Claire Fontan",
role: "Leatherworker, Portland workshop",
quote: "Leather cared for twice a year develops a patina without ever cracking: it’s the leather that ages best."
},
closing: "Two-year warranty, parts and labor.",
actions: [
{
label: "See the warranty",
action: "page",
record: {
id: "garantie"
}
}
],
figures: [
{
value: "9/10",
label: "customers see the patina by the third month"
},
{
value: "4.6/5",
label: "depth of color after a year of care"
}
],
options: {
pictureRatio: "landscape"
}
}
</script>
<template>
<StorefrontProductResultsPairTabs v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa short label above the title ("Why this jacket") |
| title* | string | Wordsthe section’s title: what makes the product worth it |
| tabs* | Tab[] | one per result: 2 to 4 as tabs, up to 12 in the grid |
| figures | Figure[] | 3 or 4 figures, the merchant’s own |
| expert | Expert | a short quote under the tabs: a real person the merchant cites |
| closing | string | Wordsa closing line, a guarantee the merchant really gives |
| actions | Action[] | the buttons under the results, each its words and page action |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Tab tabs[] · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the tab says ("Patina", "Radiance") |
| before* | string | Picturethe “before” picture of the pair |
| after* | string | Picturethe “after” picture, same frame |
| stat* | string | Wordswhat the pair shows, measured and dated as the merchant states it ("+38% perceived radiance after 4 weeks, panel of 40 people") |
Figure figures[] · 2 props
| Prop | Type | Description |
|---|---|---|
| value* | string | Wordsa real figure the merchant gave ("2 years", "98%") |
| label* | string | Wordswhat it measures |
Expert expert · 3 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe expert’s name |
| role* | string | Wordstheir role ("Leather craftswoman") |
| quote* | string | Wordstheir words, one or two sentences |
Action actions[] · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe words on the button or link |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Options options · 4 props
| Prop | Type | Description |
|---|---|---|
| pictureRatio | 'landscape' | 'square' | 'portrait' | the pictures’ frame (landscape by default) |
| beforeLabel | string | Words("Before") |
| afterLabel | string | Words("After") |
| 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 |
| Link | your router’s link component |
| 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
- Asks your app through actions:
actions[]
A storefront section, for product, landing pages; it uses @lucide/vue, class-variance-authority, clsx, reka-ui, tailwind-merge.
More storefront blocks
- Product rail aside: the heading, arrows and "See all" held in a narrow column on the left and the numbered rail running from it to the edge of the screen: a calm, editorial row for a home page with room to breathe.
- Product rail peek: one large card and the next ones peeking in from the edge: a featured selection that draws the eye to one product.
- Product rail poster: tall poster cards, the picture filling each one: its number and kind (category) at the top, the merchant’s tag at the top right, the name, summary and price over a scrim at the foot, a "Quick add" button that rises on hover and focus, arrows and a thin line showing how far the row has scrolled: a dark editorial band of a few signature pieces (a jeweller, an atelier, a gallery shop).
- Product rail: a scrolling row of product cards with prev/next arrows and a "See all" link: a section on the home page or at the end of a catalogue.
- Product routine numbered: a routine or a kit told step by step, each step pointing to the product it uses: beauty, care, DIY.
- Product selection carousel: large story cards in a scrolling row: a longer list of featured products, with the merchant’s line on each; the merchant’s own products and figures only.
- Product selection expandable: three to six products staged as tall panels, the one under the pointer widening: a few pieces, strong pictures; the merchant’s own products and figures only.
- Product selection index preview: product names set large in a ruled list, one big picture beside it that changes with the name under the pointer or focus: a short, strong range read like an index; the merchant’s own products and figures only.