Making of stacked cards — Gallery block
Freegallery-making-of-stacked-cards · for home, story, product pages
Making of stacked cards
One wide card per step, picture and words side by side, the cards piling up on each other as the page scrolls: three to eight steps told one at a time, on a brand or story page; the merchant’s own workshop 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/gallery-making-of-stacked-cardsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import GalleryMakingOfStackedCards from '@/components/trame/blocks/gallery/gallery-making-of-stacked-cards.vue'
const props = {
title: "From lump of clay to bowl",
intro: "Six steps and two weeks between raw clay and your breakfast bowl.",
steps: [
{
image: "https://images.unsplash.com/photo-1422246358533-95dcd3d48961?w=1200&q=80",
alt: "Hands kneading clay on a table",
title: "Wedging",
text: "The clay is slammed and kneaded to drive out the air: one stray bubble can crack the piece in the kiln.",
duration: "10 minutes"
},
{
image: "https://images.unsplash.com/photo-1790788369204-69ec9d2d53e7?w=1200&q=80",
alt: "A hand shaping a bowl on a potter’s wheel",
title: "Throwing",
text: "Centered on the wheel, the lump opens up and rises between the fingers into the shape of a bowl.",
duration: "15 minutes"
}
],
action: {
label: "See the bowls",
action: "collection",
record: {
id: "bols"
}
}
}
</script>
<template>
<GalleryMakingOfStackedCards v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat is made, from start to finish ("From a lump of clay to a bowl") |
| intro | string | Wordsone or two lines under the heading |
| steps* | Step[] | the steps of making one thing, in their order, each with its picture; the merchant’s own work only |
| action | Action | the call to action: its words and the page action it runs |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Step steps[] · 5 props
| Prop | Type | Description |
|---|---|---|
| image* | string | Picturea picture of this step, taken in the merchant’s own workshop |
| alt* | string | Wordswhat the picture shows, in a sentence |
| title* | string | Wordsthe step, 1 to 5 words ("The shoot") |
| text | string | Wordswhat happens at this step and why, in the maker’s words |
| duration | string | Wordshow long it takes, as the maker says it ("2 days to dry") |
Action action · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("See the bowls") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
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 |
| Link | your router’s link component |
| 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
- Expressive motion, within its budget; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
action
A gallery section, for home, story, product pages; it uses @lucide/vue, class-variance-authority, clsx, motion, reka-ui, tailwind-merge.
More gallery blocks
- Coverflow: the centred picture flat and largest, two neighbours on each side turned in depth like a stack of records being flipped through, the centred one opening large on a click: six to twelve covers, portraits or objects leafed through one at a time.
- Expandable: three to ten pictures in balanced panels with a close-up on hover: a quiet, tactile gallery with stable geometry.
- Featured image frame study: one picture shown large with its caption in mono, its table of facts and one action (order a print): a single image that deserves a page.
- Focus carousel: a single row where the centred picture is the largest, with arrows and a progress bar: a few strong pictures one at a time.
- Marquee rows: two rows of rounded pictures sliding in opposite directions, still until played: a lively wall of atmosphere on a landing.
- Masonry: a handful to a dozen pictures of mixed shapes, read top to bottom in columns, each with its caption: a general gallery.
- Media credits list: A quiet production ledger ordered by the supplied entries; the merchant’s own only.
- Media credits sessions: Session cards with credited context and a link to the recording; the merchant’s own only.