Pairing suggestions cards — Storefront block

Pro

storefront-pairing-suggestions-cards · for product pages

Pairing suggestions cards

Image-led pairing cards for serving suggestions alongside a product; 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-pairing-suggestions-cards

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontPairingSuggestionsCards from '@/components/trame/blocks/storefront/storefront-pairing-suggestions-cards.vue'

const props = {
title: "A smooth, rounded coffee",
pairings: [
{
title: "Sourdough toast",
image: "https://images.unsplash.com/photo-1662988564746-4fc159c87f2d?w=1600&q=80",
alt: "A buttered slice of bread next to its block of butter",
line: "At breakfast, with a thin layer of butter."
},
{
title: "Roasted pear",
image: "https://images.unsplash.com/photo-1573098174852-18cec8b9cdc7?w=1600&q=80",
alt: "Two roasted pear halves on a white plate",
line: "Served warm, to draw out the fruity note."
}
],
options: {
eyebrow: "Tasting notes",
intro: "Our roastery’s pointers for choosing your next cup."
}
}
</script>

<template>
<StorefrontPairingSuggestionsCards v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordsthe product’s character, in the merchant’s words
pairings*Pairing[]what goes well with the product
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Pairing pairings[] · 4 props
PropTypeDescription
title*stringWordsthe pairing’s title
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the picture shows
linestringWordsone line on why it pairs well
Options options · 3 props
PropTypeDescription
eyebrowstringWordsa small line above the heading
introstringWordsa sentence or two under the heading
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 product pages; it uses @lucide/vue.

More storefront blocks

  • Order tracker split shipments: one mini tracker per parcel under a global status: an order that leaves in several parcels.
  • Order tracker stepper: four fixed stages in a bar with their dates: a short, simple journey told at a glance.
  • Order tracker vertical timeline: the status and window on top, then every event of the carrier’s feed: the default for one parcel.
  • Package contents side by side: a product sold as a kit: the specifications and what is in the box, side by side.
  • Parcel cart by shipment: when the order leaves in several parcels or to several people: one card per delivery with its own heading and arrival, the summary beside.
  • Party details lead plus names: the one who books in a full form, then the others as one compact roster, a row per guest: a larger party where only names (or a meal choice) are needed of the rest.
  • Party details per person: a card per guest, the one who books first with every field, the others with theirs, each added or removed in place beside the booking’s summary: a small party whose guests each need a few details.
  • Past lookbooks covers grid: past lookbooks as a grid of covers with their season and status: the archive of a brand that has history.

All 409 storefront blocks