More to read side column — Blog block

Pro

blog-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-column

Usage

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.

PropTypeDescription
tagsTag[]Datathe topics of the article, as links to their pages
authorAuthorDatathe writer of the article
shareShare[]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
newsletterNewsletterthe newsletter sign-up beside the articles
openstringActionthe action that opens one article; the article is its record
openTagstringActionthe action that opens a topic; the topic is its record
openAuthorstringActionthe action that opens a writer’s page; the writer is its record
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Tag tags[] · 6 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
Author author · 7 props
PropTypeDescription
idstring | numberDatathe record’s id in the tool that answers it
name*stringWordsthe person’s name
rolestringWordstheir role or job title
companystringWordswhere they work
avatarstringPicturea picture: a root-relative path (/media/…) or an absolute URL
urlstringDesigna page about them
biostringWordswho they are, in the words the writer or the merchant chose
Share share[] · 4 props
PropTypeDescription
label*stringWordswhat the link does ("Copy the link", "Send by email")
action*stringActionthe page action that leads there: it must resolve to a real address of this article
recordRecord<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
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
title*stringWordsthe article’s title
excerptstringWordsa sentence or two from the article
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the cover picture shows
sectionstringWordsthe section it belongs to, e.g. "Guides"
authorAuthorwho wrote it
datestringWordswhen it was published, as the site writes it
readingTimestringWordshow long it takes to read, e.g. "6 min"
Author related[].author · 6 props
PropTypeDescription
idstring | numberDatathe record’s id in the tool that answers it
name*stringWordsthe person’s name
rolestringWordstheir role or job title
companystringWordswhere they work
avatarstringPicturea picture: a root-relative path (/media/…) or an absolute URL
urlstringDesigna page about them
MostRead mostRead[] · 9 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
title*stringWordsthe article’s title
excerptstringWordsa sentence or two from the article
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the cover picture shows
sectionstringWordsthe section it belongs to, e.g. "Guides"
authorAuthorwho wrote it
datestringWordswhen it was published, as the site writes it
readingTimestringWordshow long it takes to read, e.g. "6 min"
Author mostRead[].author · 6 props
PropTypeDescription
idstring | numberDatathe record’s id in the tool that answers it
name*stringWordsthe person’s name
rolestringWordstheir role or job title
companystringWordswhere they work
avatarstringPicturea picture: a root-relative path (/media/…) or an absolute URL
urlstringDesigna page about them
Newsletter newsletter · 5 props
PropTypeDescription
title*stringWordswhat the journal sends and how often, in one line
textstringWordsa sentence more, if needed
submit*stringActionthe page action that receives the address
submitLabel*stringWordsthe button’s words ("Subscribe")
consent*stringWordsthe consent sentence under the field: required
Options options · 5 props
PropTypeDescription
relatedTitlestringWordsthe title over the related stories ("Read next")
mostReadTitlestringWordsthe title over the most read ("Most read")
status'success' | 'error'the section’s status: success, error
statusTextstringWordsthe answer to the newsletter form, as the app gives it
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: share[], newsletter.submit, open, openTag, openAuthor
  • Reads articles, categories from 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.

All 35 blog blocks