Product profile scale bars — Storefront block

Pro

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

Usage

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.

PropTypeDescription
title*stringWordsthe product’s character, in the merchant’s words
scales*Scale[]the product’s profile, each a scale between two ends
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Scale scales[] · 3 props
PropTypeDescription
label*stringWordswhat the figure is
value*numberDesignposition supplied by the merchant, never a generated score
ends*unknownthe words at the low and the high end
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
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.

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.

All 409 storefront blocks