Series alternating facts — Gallery block

Pro

gallery-series-alternating-facts · for home, landing, article pages

Series alternating facts

Each series’ lead picture beside its title, text and table of facts (place, equipment, date), the next one mirrored: a photographer’s or maker’s portfolio

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-series-alternating-facts

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import GallerySeriesAlternatingFacts from '@/components/trame/blocks/gallery/gallery-series-alternating-facts.vue'

const props = {
title: "Three trail notebooks",
intro: "Each series fits in a handful of pictures, taken along the way by the studio team.",
sets: [
{
title: "The crossing",
caption: "Four days from ridge to ridge, from the first pass to the last summit.",
images: [
{
src: "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1600&q=80",
alt: "A snowy ridge at sunrise, above a sea of clouds",
caption: "Needle Ridge, 6:40 a.m., the first day of the crossing."
},
{
src: "https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=1600&q=80",
alt: "A trail through a forest of tall trees",
caption: "Under the tall trees, before the climb."
}
],
facts: [
{
label: "Location",
value: "Chartreuse Mountains"
},
{
label: "Gear",
value: "Mirrorless body, 35 mm lens"
}
]
},
{
title: "The lake",
caption: "Two evenings by the water.",
images: [
{
src: "https://images.unsplash.com/photo-1501785888041-af3ef285b470?w=1600&q=80",
alt: "A still lake ringed by mountains, seen from the shore",
caption: "The lake, at the hour the wind drops."
},
{
src: "https://images.unsplash.com/photo-1469474968028-56623f02e42e?w=1600&q=80",
alt: "A misty mountain valley, a figure standing on a rock"
}
],
facts: [
{
label: "Location",
value: "Chartreuse Mountains"
},
{
label: "Gear",
value: "Mirrorless body, 35 mm lens"
}
]
}
],
action: {
label: "See all the series",
action: "page",
record: {
id: "carnets"
}
}
}
</script>

<template>
<GallerySeriesAlternatingFacts v-bind="props" />
</template>

Props

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

PropTypeDescription
titlestringWordsthe section’s heading, if it needs one
introstringWordsone or two lines under the heading
sets*Set[]the series in the order the author wants them read, each with its pictures
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
Set sets[] · 4 props
PropTypeDescription
title*stringWordsthe series’ title
captionstringWordswhat it is, in the author’s words
images*Image[]the set’s pictures, in order
factsFact[]short facts about the set, as the merchant states them
Image sets[].images[] · 3 props
PropTypeDescription
src*stringPicturea picture: a root-relative path (/media/…) or an absolute URL
alt*stringWordswhat the picture shows, in a sentence: required, it is the picture for those who do not see it
captionstringWordsthe author’s caption, if the picture has one
Fact sets[].facts[] · 2 props
PropTypeDescription
label*stringWords("Place", "Equipment", "Pictures")
value*stringWordsas the author wrote it: no estimate, no invented edition size
Action action · 3 props
PropTypeDescription
label*stringWordswhat happens ("See the series", "Order a print")
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, landing, article pages; it uses class-variance-authority, clsx, motion, reka-ui, tailwind-merge.

More gallery blocks

  • Photo essay full bleed: each chapter opens on a title and its pictures run edge to edge, drifting slowly, with a narrow caption under each: a few very strong pictures that need the whole width.
  • Photo essay pinned captions: a caption column that stays in view while the chapter’s large pictures scroll past: a trip, a making-of or a reportage told picture by picture.
  • Photo essay spreads: magazine spreads where a large and a small picture sit off-centre on a grid with the chapter’s words between them: an editorial, slower read of a series.
  • Prints: pictures as loose prints on a table, slightly turned and straightening on hover: an informal, human wall of a maker’s or a trip’s snapshots.
  • Scatter: five to nine small pictures of three sizes placed around a centred heading with plenty of air: a playful, airy wall of objects, products or details.
  • Stage: one large picture on a stage with its caption, and a filmstrip of thumbnails to pick the next: four to twelve pictures of one series to look at closely, one by one.
  • Strip: tall pictures in a row that scrolls sideways past the page’s edge, with a count: a photo essay told in order.
  • Workshop photos photo essay: captioned pictures of the workshops in balanced rows, the caption being the content: a visit told in pictures.

All 23 gallery blocks