End stacked — Article block
Proarticle-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-stackedUsage
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.
| 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 |
| newsletter | Newsletter | the newsletter sign-up at the end |
| 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 |
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 · 4 props
| Prop | Type | Description |
|---|---|---|
| relatedTitle | string | Wordsthe title over the related stories ("Read next") |
| 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 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.