Fit models cards — Storefront block

Pro

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

Usage

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.

PropTypeDescription
title*stringWordsthe block’s title ("Size guide")
introstringWordshow 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
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Model models[] · 7 props
PropTypeDescription
name*stringWordsa first name or a label ("Model 1"), a real model of the merchant
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the picture shows
heightstringWords("1.78 m")
measurementsMeasurement[]the model’s measurements, each a label and a value
size*stringWordsthe size worn ("M")
notestringWordshow it fits this person
Measurement models[].measurements[] · 2 props
PropTypeDescription
label*stringWordswhat the value is about
value*stringWordsthe value, as the merchant states it
Options options · 1 props
PropTypeDescription
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.

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.

All 409 storefront blocks