End stacked — Article block

Pro

article-end-stacked · for article pages

End stacked

The usual close of a long read: topics, the writer, one newsletter row, then up to three related stories side by side

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/article-end-stacked

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import ArticleEndStacked from '@/components/trame/blocks/article/article-end-stacked.vue'

const props = {
tags: [
{
id: "lineup",
name: "Lineup"
},
{
id: "backstage",
name: "Backstage"
}
],
author: {
name: "Jonah Reyes",
role: "Programmer, Low Tide Festival",
bio: "He books the late-night tent and writes the festival notes between two soundchecks."
},
share: [
{
label: "Copy link",
action: "article-link",
kind: "link"
},
{
label: "Send by email",
action: "article-mail",
kind: "mail"
}
],
related: [
{
id: "tour",
title: "Golden hour on the main field: how we time the sunset sets",
excerpt: "Why the headliner never plays before nine, and the stage crew’s three-minute changeover.",
image: "https://images.unsplash.com/photo-1787677357235-063a9982610c?w=1600&q=80",
alt: "An outdoor crowd in front of a stage at golden hour",
section: "Backstage",
date: "September 12",
readingTime: "6 min read"
},
{
id: "etagere",
title: "Building a stage on the sand, in four days",
excerpt: "Tides, wind and four hundred tonnes of steel, in the order they arrive.",
image: "https://images.unsplash.com/photo-1790511637969-5864152f9e38?w=1600&q=80",
alt: "A seaside stage at dusk, pink lights over the crowd",
section: "Behind the scenes",
date: "September 3",
readingTime: "4 min read"
}
],
newsletter: {
title: "Low Tide notes, once a month",
text: "Lineup news, ticket dates and one story from backstage, nothing else.",
submit: "newsletter",
submitLabel: "Subscribe",
consent: "Your address is only used to send the notes. Every issue includes an unsubscribe link."
},
open: "article",
openTag: "topic",
openAuthor: "author",
options: {
relatedTitle: "Read next",
mood: "inverse"
}
}
</script>

<template>
<ArticleEndStacked 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
newsletterNewsletterthe newsletter sign-up at the end
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
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 · 4 props
PropTypeDescription
relatedTitlestringWordsthe title over the related stories ("Read next")
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 article section, for article pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.

More article blocks

  • Author block spotlight: a card with the writer’s portrait and bio beside their best articles: the end of an article, or a journal’s guest of the month.
  • Byline inline: one line under an article’s title: portrait, name, role, date and reading time.
  • Interview classic: a printed interview: the person introduced above, questions in bold, answers in a calm column, pull quotes between.
  • Interview conversation: questions and answers as two voices on opposite sides, the person’s portrait beside each answer: a lighter, human interview.
  • Interview margin names: speakers named in a margin column, the text beside them: a long interview read like a transcript.
  • Layout aside related: a long article whose key facts and next reads should stay in view: the cover wide above a reading column and a sticky aside holding both.
  • Layout deep dive: an article with figures in its flow: wide captioned pictures, fact tables and large pull quotes breaking out of the column.
  • Layout prose: an ordinary article: a centred reading column, the cover wide above it, topics and the next reads below.

All 29 article blocks