More to read side column — Blog block
Problog-more-to-read-side-column · for article pages
More to read side column
The writer and the newsletter in the main column, a side column of related links and the most read the journal itself ranks: a news-like article
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-more-to-read-side-columnUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import BlogMoreToReadSideColumn from '@/components/trame/blocks/blog/blog-more-to-read-side-column.vue'
const props = {
tags: [
{
id: "atelier",
name: "Workshop"
},
{
id: "ceramique",
name: "Ceramics"
}
],
author: {
name: "Ivy Aubrac",
role: "Journal editor",
bio: "She writes about craft and materials from the workshop, between two firings."
},
share: [
{
label: "Copy link",
action: "article-link",
kind: "link"
},
{
label: "Send by email",
action: "article-mail",
kind: "mail"
}
],
related: [
{
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 read"
},
{
id: "etagere",
title: "What the shelves of a ceramics studio tell you",
excerpt: "Bowls drying slowly, in the order they were thrown.",
image: "https://images.unsplash.com/photo-1772607407371-44031ae3b69f?w=1600&q=80",
alt: "Unfired clay bowls on wooden shelves",
section: "Behind the scenes",
date: "September 3",
readingTime: "4 min read"
}
],
mostRead: [
{
id: "lin",
title: "Washing linen: twenty years of small mistakes"
},
{
id: "serre",
title: "The greenhouse in October, or how to hold out until spring"
}
],
newsletter: {
title: "The workshop journal, once a month",
text: "One story, one photo and the list of new arrivals, nothing else.",
submit: "newsletter",
submitLabel: "Subscribe",
consent: "Your address is only used to send the journal. Every issue includes an unsubscribe link."
},
open: "article",
openTag: "topic",
openAuthor: "author",
options: {
relatedTitle: "Read next",
mostReadTitle: "Most read"
}
}
</script>
<template>
<BlogMoreToReadSideColumn v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| tags | Tag[] | Datathe topics of the article, as links to their pages |
| author | Author | Datathe writer of the article |
| share | Share[] | Datathe ways to pass the article on: only real addresses of the site, no counts |
| related* | Related[] | Datathe stories to read next, as the journal chose them |
| mostRead* | MostRead[] | Datathe articles the journal itself ranks as most read: only a block of a journal that keeps such a count |
| newsletter | Newsletter | the newsletter sign-up beside the articles |
| open | string | Actionthe action that opens one article; the article is its record |
| openTag | string | Actionthe action that opens a topic; the topic is its record |
| openAuthor | string | Actionthe action that opens a writer’s page; the writer is its record |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Tag tags[] · 6 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 |
Author author · 7 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 |
| bio | string | Wordswho they are, in the words the writer or the merchant chose |
Share share[] · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the link does ("Copy the link", "Send by email") |
| action* | string | Actionthe page action that leads there: it must resolve to a real address of this article |
| record | Record<string, unknown> | Datathe record the action opens, if any |
| kind | 'link' | 'mail' | 'save' | 'print' | the icon: link (default), mail, save or print |
Related related[] · 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 related[].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 |
MostRead mostRead[] · 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 mostRead[].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 |
Newsletter newsletter · 5 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat the journal sends and how often, in one line |
| text | string | Wordsa sentence more, if needed |
| submit* | string | Actionthe page action that receives the address |
| submitLabel* | string | Wordsthe button’s words ("Subscribe") |
| consent* | string | Wordsthe consent sentence under the field: required |
Options options · 5 props
| Prop | Type | Description |
|---|---|---|
| relatedTitle | string | Wordsthe title over the related stories ("Read next") |
| mostReadTitle | string | Wordsthe title over the most read ("Most read") |
| status | 'success' | 'error' | the section’s status: success, error |
| statusText | string | Wordsthe answer to the newsletter form, as the app gives it |
| 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 |
| asset | a picture’s address as your app serves it |
| 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:
share[],newsletter.submit,open,openTag,openAuthor - Reads
articles,categoriesfrom your app
A blog section, for article pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.
More blog blocks
- Guide shelves tabs: one shelf at a time, the topic tabs swap its guides, the first one large: four to twelve guides in a small space.
- Journal masthead: a journal that sells itself as a title: the name very large and centred between hairlines, the lead beside its cover, other stories in ruled text columns.
- Latest lines: one line per article, date and title, no excerpt: a teaser at the foot of a page or of a product.
- Lead and rail: the usual blog home: one large lead story and two or three short stories stacked beside it.
- Next in series lead card: one large "read next" card with its cover and, for a series or an issue, the list of its articles: a series or a numbered issue.
- Past issues numbered list: numbered issues with their date and one line, a subscribe card beside them: a letter or a periodical.
- 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.