Making of rail — Gallery block

Free

gallery-making-of-rail · for home, story, product pages

Making of rail

Tall step cards in a row that scrolls sideways, a large number over each picture and a bar showing how far along the row is: a home or product band that shows the making in a glance; 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-rail

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import GalleryMakingOfRail from '@/components/trame/blocks/gallery/gallery-making-of-rail.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>
<GalleryMakingOfRail v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordswhat is made, from start to finish ("From a lump of clay to a bowl")
introstringWordsone 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
actionActionthe call to action: its words and the page action it runs
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Step steps[] · 5 props
PropTypeDescription
image*stringPicturea picture of this step, taken in the merchant’s own workshop
alt*stringWordswhat the picture shows, in a sentence
title*stringWordsthe step, 1 to 5 words ("The shoot")
textstringWordswhat happens at this step and why, in the maker’s words
durationstringWordshow long it takes, as the maker says it ("2 days to dry")
Action action · 3 props
PropTypeDescription
label*stringWordswhat happens ("See the bowls")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
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
Linkyour router’s link component
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
  • 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

  • Card deck: a deck of rounded cards stacked in the centre, the top one sent to the back with the arrows, the dots or a swipe: five to ten portraits or covers shown one by one with some play.
  • 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.

All 23 gallery blocks