Fit models cards — Storefront block
Prostorefront-fit-models-cards · for product pages
Fit models cards
Clothes worn by real people: height, measurements and the size each one wears, to compare with oneself
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-fit-models-cardsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontFitModelsCards from '@/components/trame/blocks/storefront/storefront-fit-models-cards.vue'
const props = {
title: "Find your size",
intro: "Our measurements are taken flat on the finished garment. Compare them with a piece you already wear.",
models: [
{
name: "Ivy",
size: "S",
image: "https://images.unsplash.com/photo-1538516089546-40b08c9c9866?w=1600&q=80",
alt: "Ivy in a navy rain jacket, size S",
height: "5′4″",
measurements: [
{
label: "Chest",
value: "86 cm"
},
{
label: "Waist",
value: "68 cm"
}
],
note: "Fitted cut, sleeves the right length."
},
{
name: "Hugo",
size: "L",
image: "https://images.unsplash.com/photo-1578100044626-110806c15b00?w=1600&q=80",
alt: "Hugo in a denim jacket, size L",
height: "5′11″",
measurements: [
{
label: "Chest",
value: "98 cm"
},
{
label: "Waist",
value: "82 cm"
}
],
note: "A little room in the shoulders, comfortable over a sweater."
}
]
}
</script>
<template>
<StorefrontFitModelsCards v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe block’s title ("Size guide") |
| intro | string | Wordshow to read it, or how to measure ("Measure yourself without thick clothing"), as the merchant wrote it |
| models* | Model[] | the models who wear the piece, each with their size and measurements |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Model models[] · 7 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsa first name or a label ("Model 1"), a real model of the merchant |
| image | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the picture shows |
| height | string | Words("1.78 m") |
| measurements | Measurement[] | the model’s measurements, each a label and a value |
| size* | string | Wordsthe size worn ("M") |
| note | string | Wordshow it fits this person |
Measurement models[].measurements[] · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the value is about |
| value* | string | Wordsthe value, as the merchant states it |
Options options · 1 props
| Prop | Type | Description |
|---|---|---|
| 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 |
| 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
- Featured selection grid: the first product double-sized with two buttons, then a grid: one product to push among others; the merchant’s own products and figures only.
- Finder intro card: A question prompt, step count and image strip invite the visitor to start the quiz, with micro motion only.
- Finder results cards: Recommended product cards with reasons, restart and see-all actions conclude a quiz; the merchant’s own rules only, with micro motion only.
- Fit by size tabs: a size at a time: a row of size chips, and under it that size’s measurements and the models who wear it, to picture it before choosing.
- Floating products staggered: two staggered columns of tall cards whose pictures drift at opposite paces as the page scrolls: an editorial run of 4 to 12 products; the merchant’s own products and figures only.
- Fulfilment choice cards: a product that can be delivered or picked up: a switch and the stores with their distance and stock.
- Fulfilment estimator card: a bordered card listing every shipping option with its delay and price: a cart or a product with several carriers.
- Fulfilment estimator inline: a compact line under the price: a postcode field and the cheapest answer, for a product page that must stay short.