Topic starts rows — Blog block
Problog-topic-starts-rows · for journal pages
Topic starts rows
Hairline rows, each theme with its count and the article to begin with: a deep journal read without pictures
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-starts-rowsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import BlogTopicStartsRows from '@/components/trame/blocks/blog/blog-topic-starts-rows.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>
<BlogTopicStartsRows v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe block’s title ("Browse by theme") |
| lead | string | Wordsone sentence under the title |
| topics* | Topic[] | Datathe journal’s themes with the number of articles the shop counts in each |
| open | string | Actionthe action that opens a theme; the theme is its record |
| openArticle | string | Actionthe action that opens the starter article; the article is its record |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Topic topics[] · 9 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe category’s name |
| image | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the category’s picture shows |
| count | number | how many products it holds |
| summary | string | Wordsone short line on the category |
| icon | string | Designa small icon for the theme: book, wrench, scissors, leaf, sparkles, hammer, shirt, compass, clock |
| start | Start | the article the shop suggests to begin with |
| detail | string | Wordsa practical line for a how-to ("40 min · a hair dryer"), as the merchant wrote it |
Start topics[].start · 3 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| title* | string | Wordsthe article’s title |
| section | string | Wordsthe section the starting article belongs to |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| showCount | boolean | whether each topic’s count is shown |
| 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 |
| 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
- Subtle motion: one short reveal; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
open,openArticle - Reads
categories,articlesfrom your app
A blog section, for journal pages; it uses @lucide/vue, clsx, motion, tailwind-merge.
More blog blocks
- Series shelf cards: one card per series with its parts, total time and status: a journal that publishes in series.
- Topic index guide cards: picture cards for how-tos, each with its practical line: a journal of guides and tutorials.
- Topic index tiles icon: tiles with an icon, a count and a one-sentence scope: a journal with a handful of clear themes.
- 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).
- Topic rails text rail: the topics as columns of kickers and headlines, no picture: a news-like or archive home.
- Writers index grid: every writer of the journal in a grid of portraits, beat and a line of bio: the journal’s "who writes" page.