Product overview minimal spec — Storefront block

Free

storefront-product-overview-minimal-spec · for product pages

Product overview minimal spec

One picture, the options and a definition list of facts: a catalogue with few photos or technical goods

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-overview-minimal-spec

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontProductOverviewMinimalSpec from '@/components/trame/blocks/storefront/storefront-product-overview-minimal-spec.vue'

const props = {
product: {
id: "trail-sentier",
name: "Trail Path running shoe",
brand: "Summit Workshop",
price: 12900,
compareAt: 15900,
currency: "USD",
image: "https://images.unsplash.com/photo-1575987116913-e96e7d490b8a?w=1600&q=80",
images: [
"https://images.unsplash.com/photo-1575987116913-e96e7d490b8a?w=1600&q=80",
"https://images.unsplash.com/photo-1530792271526-7ddf516473b3?w=1600&q=80"
],
summary: "A light trail running shoe for long outings.",
description: "A light trail running shoe with a 5 mm lugged sole, designed for long outings on dry or wet trails. Breathable upper, welded tongue, supported heel.",
badge: "New",
rating: 4.6,
reviewCount: 38,
options: [
{
name: "Color",
values: [
"Midnight blue",
"Sand"
]
},
{
name: "Size",
values: [
"39",
"40"
]
}
],
variants: [
{
id: "0-39",
options: {
Couleur: "Midnight blue",
Taille: "39"
},
available: true,
stock: 12
},
{
id: "0-40",
options: {
Couleur: "Midnight blue",
Taille: "40"
},
available: true,
stock: 3
}
],
facts: [
{
label: "Weight",
value: "9.5 oz (EU size 42)"
},
{
label: "Drop",
value: "6 mm"
}
]
},
trust: [
"Free returns within 30 days",
"Secure payment"
],
actions: {
add: "cart.add",
wishlist: "wishlist.add",
sizeGuide: "size-guide"
},
options: {
wishlistLabel: "Add to favorites",
sizeGuideLabel: "Size guide",
optionWithSizeGuide: "Size"
}
}
</script>

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

Props

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

PropTypeDescription
product*ProductDatathe product, with its pictures, options and variants
breadcrumbBreadcrumb[]the path to the product, from the home page; its last item is the product itself, shown as the current page
truststring[]Wordsa promise the merchant keeps ("Returns within 30 days")
actionsActionsthe page actions the block runs, each described below
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Product product · 22 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
name*stringWordsthe product’s name
price*numberan amount in cents
compareAtnumberthe price before the merchant’s reduction
currencystringDesignISO 4217, EUR by default
imagestring | nullPicturethe main picture; null or absent: the product has none yet
images(string | Image)[]its pictures: an address, or an address with what that picture shows (its own alt)
altstringWordswhat the main picture shows
brandstringWordsthe brand or maker
categorystringWordsthe product’s category, e.g. "Knitwear"
summarystringWordsone short line on the product
badgestringWordsa short tag the merchant set ("New", "Handmade")
ratingnumberthe average of the shop’s own stored reviews
reviewCountnumberhow many stored reviews the rating averages
availablebooleanfalse: sold out; true or absent: can be bought
stocknumberthe real stock, when the merchant shows it
maxQuantitynumberthe most one order may hold of it, as the merchant set it (one per customer, a limited run)
optionsOption[]the product’s options and their values, e.g. sizes
highlightsHighlight[]a few key facts the merchant set, shown on the product’s card
descriptionstringWordsthe product’s presentation, in the merchant’s words
factsFact[]the product’s key facts, each a property and its value, e.g. "Material": "Full-grain leather"
variantsVariant[]every combination of options the product comes in, with its own price and stock
Option product.options[] · 2 props
PropTypeDescription
name*stringWordsthe option’s name, e.g. "Size"
values*string[]Wordsits values, e.g. "S", "M", "L"
Highlight product.highlights[] · 2 props
PropTypeDescription
label*stringWordsthe property ("Material", "Capacity")
value*stringWordsits value, as the merchant states it ("Washed linen", "50 cl")
Fact product.facts[] · 2 props
PropTypeDescription
label*stringWords"Material"
value*stringWords"Full-grain leather"
Variant product.variants[] · 5 props
PropTypeDescription
id*string | numberthe variant’s id, sent with cart.add
options*Record<string, string>the value of each option for this variant, by option name, e.g. { "Colour": "Navy" }
pricenumberits own price in cents, when it differs
availablebooleanfalse: the variant is sold out
stocknumberthe variant’s real stock, when the merchant shows it
Breadcrumb breadcrumb[] · 4 props
PropTypeDescription
label*stringWordsthe link’s words, e.g. "See the collection"
actionstringActiona named action of the page
recordRecord<string, unknown>Datathe record the action applies to, passed to the host with it, if any
urlstringDesignan address outside the app
Actions actions · 3 props
PropTypeDescription
add*stringActionthe action the add-to-cart form posts to
wishliststringActiona named action of the page
sizeGuidestringActiona named action of the page
Options options · 4 props
PropTypeDescription
wishlistLabelstringWords"Add to favourites"
sizeGuideLabelstringWords"Size guide"
optionWithSizeGuidestringWordsthe name of the option the size guide belongs to ("Size")
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
moneyformats a price, given in cents
asseta picture’s address as your app serves it
Linkyour router’s link component
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
  • Asks your app through actions: breadcrumb[], cart.add, actions.wishlist, actions.sizeGuide
  • Reads products from your app

A storefront section, for product pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.

Built with

The components this block is made of; each one installs on its own too.

More storefront blocks

  • Product grid editorial: one large tile every few products and an optional banner cell: a catalogue that reads like a magazine page, for a short or curated list.
  • Product grid rows: a dense list, one product per row with its summary and options: for large catalogues and visitors who compare facts.
  • Product grid: the catalogue’s standard grid, four columns on a wide screen: every product equal, so a visitor compares quickly.
  • Product hotspots markers: a product seen as a whole where details matter (a bag, a watch): numbered markers on one picture, the list beside it.
  • Product information sheet drawer: Long materials, ingredients or care copy in a side panel opened from compact rows; the merchant’s own only.
  • Product offer panel frequency: a product bought once or on subscription: two selectable cards, the saving as a number, a button that restates the choice.
  • 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.
  • Product profile scale bars: Labelled scales with a precise marker for roast, body or intensity; the merchant’s own only.

All 409 storefront blocks