Product profile scale bars — Storefront block
Prostorefront-product-profile-scale-bars · for product pages
Product profile scale bars
Labelled scales with a precise marker for roast, body or intensity; 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-profile-scale-barsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontProductProfileScaleBars from '@/components/trame/blocks/storefront/storefront-product-profile-scale-bars.vue'
const props = {
title: "A smooth, rounded coffee",
scales: [
{
label: "Roast",
value: 0.6,
ends: [
"Light",
"Dark"
]
},
{
label: "Intensity",
value: 0.7,
ends: [
"Delicate",
"Intense"
]
}
],
options: {
eyebrow: "Tasting notes",
intro: "Our roastery’s pointers for choosing your next cup."
}
}
</script>
<template>
<StorefrontProductProfileScaleBars v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe product’s character, in the merchant’s words |
| scales* | Scale[] | the product’s profile, each a scale between two ends |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Scale scales[] · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the figure is |
| value* | number | Designposition supplied by the merchant, never a generated score |
| ends* | unknown | the words at the low and the high end |
Options options · 3 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa small line above the heading |
| intro | string | Wordsa sentence or two under the heading |
| 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 |
| 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 product pages.
More storefront blocks
- 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 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 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.
- Product quick view bottom sheet: a sheet rising from the bottom edge, a small picture beside the name: phones, one thumb away.