Material shelf grid — Storefront block
Prostorefront-material-shelf-grid · for home, product, landing pages
Material shelf grid
Three or four columns, a round photo, the name and one line each: a brand page that lists its materials
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-material-shelf-gridUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontMaterialShelfGrid from '@/components/trame/blocks/storefront/storefront-material-shelf-grid.vue'
const props = {
title: "What our pieces are made of",
intro: "Seven materials, each chosen for what it brings to everyday use, and found from one collection to the next.",
items: [
{
name: "Washed linen",
image: "https://images.unsplash.com/photo-1528458909336-e7a0adfed0a5?w=900&q=80",
alt: "A close-up of beige linen cloth",
line: "Washed by the bolt before sewing, it is soft from day one and only gets softer with time.",
detailAction: "material"
},
{
name: "Undyed wool",
image: "https://images.unsplash.com/photo-1670764732222-e787bccd934f?w=900&q=80",
alt: "A skein of undyed wool",
line: "Spun without dye, it keeps the color of the fleece and its slightly rustic feel.",
detailAction: "material"
}
],
options: {
eyebrow: "Materials"
}
}
</script>
<template>
<StorefrontMaterialShelfGrid v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe title ("What our pieces are made of") |
| intro | string | Wordsone sentence on why these materials, as the merchant says it |
| items* | Item[] | the items shown, in order |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Item items[] · 6 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe material, ingredient or component ("Washed linen", "Beeswax") |
| image | string | Picturea picture of the material itself |
| alt | string | Wordswhat the picture shows, when the name does not say it |
| line* | string | Wordsone line on why the merchant uses it, in the merchant’s own words: no claim the merchant did not make |
| detailAction | string | Actionthe page action of the material’s entry page ("glossary-link"); it receives `{ id }` |
| id | string | Designwhat the entry page is looked up by; the name when absent |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa short line above the title ("Materials") |
| 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
- Asks your app through actions:
items[].detailAction
A storefront section, for home, product, landing pages; it uses clsx, motion, tailwind-merge.
More storefront blocks
- Lookbook cover: the first frame as a wide magazine cover with the title and the link on its foot, the other frames as a numbered contact sheet with their captions and notes: a full shoot with one picture strong enough to open it.
- Lookbook pinboard: taped prints slightly rotated on a board that straighten under the pointer, with their caption and note: a casual, handmade lookbook or team picks.
- Loyalty points overview: The balance, where the customer stands on the merchant’s tiers and what the next one unlocks, and the latest movements.
- Made to order offer ledger: a product made after the order: when it is made and shipped, the queue, and a button that says when it is charged.
- Member card: a signed-in member: the card with their number, tier and points toward the next reward.
- Member offer perks band: a loyalty or member club with a few benefits: a dark panel, the invitation beside a grid of perks.
- Member savings bars: show a member what the programme saved them, period by period, in their own figures.
- Member tiers beside picture: a programme with one or two levels: the tiers as cards beside a picture.