Topic index guide cards — Blog block

Pro

blog-topic-index-guide-cards · for journal pages

Topic index guide cards

Picture cards for how-tos, each with its practical line: a journal of guides and tutorials

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/blog-topic-index-guide-cards

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import BlogTopicIndexGuideCards from '@/components/trame/blocks/blog/blog-topic-index-guide-cards.vue'

const props = {
title: "Browse by topic",
lead: "Pick a way in; every topic has its starting article.",
topics: [
{
id: "matieres",
name: "Materials",
count: 12,
icon: "leaf",
summary: "Leathers, canvases, linens: where they come from and how they age.",
start: {
id: "a1",
title: "How we choose our leathers"
},
image: "https://images.unsplash.com/photo-1637759292654-a12cb2be085e?w=1600&q=80",
alt: "Cognac-brown leather, a close-up of a fold and a seam",
detail: "10 min read"
},
{
id: "entretien",
name: "Care",
count: 8,
icon: "wrench",
summary: "Wash, condition, store: the habits that make things last.",
start: {
id: "a2",
title: "Caring for a waxed canvas bag"
},
image: "https://images.unsplash.com/photo-1602845860431-35374f24f48d?w=1600&q=80",
alt: "A mustard canvas backpack with leather straps, resting in the grass",
detail: "20 min · a soft cloth"
}
]
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe block’s title ("Browse by theme")
leadstringWordsone sentence under the title
topics*Topic[]Datathe journal’s themes with the number of articles the shop counts in each
openstringActionthe action that opens a theme; the theme is its record
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Topic topics[] · 9 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
name*stringWordsthe category’s name
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the category’s picture shows
countnumberhow many products it holds
summarystringWordsone short line on the category
iconstringDesigna small icon for the theme: book, wrench, scissors, leaf, sparkles, hammer, shirt, compass, clock
startStartthe article the shop suggests to begin with
detailstringWordsa practical line for a how-to ("40 min · a hair dryer"), as the merchant wrote it
Start topics[].start · 3 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
title*stringWordsthe article’s title
sectionstringWordsthe section the starting article belongs to
Options options · 2 props
PropTypeDescription
showCountbooleanwhether each topic’s count is shown
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
  • Subtle motion: one short reveal; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: open
  • Reads categories, articles from your app

A blog section, for journal pages; it uses @lucide/vue, clsx, motion, tailwind-merge.

More blog blocks

  • Reading path numbered rail: a vertical rail of numbered steps with a line of why for each: a newcomer’s guided tour of the journal.
  • Section page chips grid: a section with several siblings: a row of filter links above a grid of cards.
  • Section page featured then list: a section led by one article: the newest in full, the rest as a plain list below.
  • Section page masthead list: a section with a strong identity: a large title, its description and count, then boxed rows with the author’s line.
  • Series shelf cards: one card per series with its parts, total time and status: a journal that publishes in series.
  • Topic rails cards rail: a swipeable row of picture cards for each topic, with its "see all": a journal with strong covers.
  • Topic rails lead per topic: each topic opens on one large story, the others in a row beside it: a magazine with sections.
  • Topic rails numbered: each topic as a numbered list, in the order the journal ranks it: a curated "best of" (the journal’s own ranking only).

All 35 blog blocks