Topic rails numbered — Blog block
Problog-topic-rails-numbered · for home, journal pages
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)
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-rails-numberedUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import BlogTopicRailsNumbered from '@/components/trame/blocks/blog/blog-topic-rails-numbered.vue'
const props = {
title: "The journal, by topic",
lead: "Four sections, each with its latest pieces.",
topics: [
{
id: "atelier",
title: "Workshop",
summary: "The craft, the tools and what happens before the finished piece.",
articles: [
{
id: "tour",
title: "Why our bowls are always thrown on the same wheel",
excerpt: "A forty-year-old tool, three settings and a habit no one wanted to change.",
image: "https://images.unsplash.com/photo-1676125105332-608345abe20e?w=1600&q=80",
alt: "A potter’s wheel surrounded by tools and clay",
section: "Workshop",
date: "September 12",
readingTime: "6 min"
},
{
id: "bois",
title: "Mark, cut, sand: the gesture before the piece",
excerpt: "A board, a pencil and the patience it takes not to waste a thing.",
image: "https://images.unsplash.com/photo-1659930087003-2d64e33181f7?w=1600&q=80",
alt: "Hands drawing a pencil line on a board",
section: "Workshop",
date: "September 4",
readingTime: "4 min"
}
]
},
{
id: "jardin",
title: "Garden",
summary: "What we sow, what we bring in and what we leave to nature.",
articles: [
{
id: "serre",
title: "The greenhouse in October, or how to hold out until spring",
excerpt: "What comes inside, what stays out and what we still sow.",
image: "https://images.unsplash.com/photo-1508857650881-64475119d798?w=1600&q=80",
alt: "Inside a greenhouse, rows of young seedlings",
section: "Garden",
date: "September 10",
readingTime: "7 min"
},
{
id: "semis",
title: "Sowing in September: five common mistakes",
excerpt: "Too early, too close together, too much water.",
section: "Garden",
date: "September 1",
readingTime: "4 min"
}
]
}
],
open: "article",
openTopic: "topic",
options: {
eyebrow: "Journal"
}
}
</script>
<template>
<BlogTopicRailsNumbered v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe title over all the rails ("The journal", "Read by topic") |
| lead | string | Wordsone sentence under the title, if it needs one |
| topics* | Topic[] | Datathe journal’s topics, each with its stories: topics with no story are left out |
| open | string | Actionthe action that opens one article; the article is its record |
| openTopic | string | Actionthe action that opens a topic’s page ("See all"); the topic is its record |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Topic topics[] · 4 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe topic’s id in the tool that answers it |
| title* | string | Wordsthe topic’s name ("Workshop", "Garden") |
| summary | string | Wordsone sentence on what the topic covers |
| articles* | Article[] | its stories, in the order the journal wants them read: newest first, or ranked for "numbered" |
Article topics[].articles[] · 9 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| title* | string | Wordsthe article’s title |
| excerpt | string | Wordsa sentence or two from the article |
| image | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the cover picture shows |
| section | string | Wordsthe section it belongs to, e.g. "Guides" |
| author | Author | who wrote it |
| date | string | Wordswhen it was published, as the site writes it |
| readingTime | string | Wordshow long it takes to read, e.g. "6 min" |
Author topics[].articles[].author · 6 props
| Prop | Type | Description |
|---|---|---|
| id | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe person’s name |
| role | string | Wordstheir role or job title |
| company | string | Wordswhere they work |
| avatar | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| url | string | Designa page about them |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa short label over the title |
| 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,openTopic - Reads
articles,categoriesfrom your app
A blog section, for home, journal pages; it uses @lucide/vue, clsx, motion, tailwind-merge.
More blog blocks
- 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 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 starts rows: hairline rows, each theme with its count and the article to begin with: a deep journal read without pictures.
- 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.