Layout prose — Article block

Free

article-layout-prose · for article pages

Layout prose

An ordinary article: a centred reading column, the cover wide above it, topics and the next reads below

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-layout-prose

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import ArticleLayoutProse from '@/components/trame/blocks/article/article-layout-prose.vue'

const props = {
breadcrumb: [
{
label: "Home",
action: "home"
},
{
label: "Advice",
action: "journal"
}
],
title: "Back on the trail after a knee injury: a six-week plan",
standfirst: "What to do, what to avoid, and when it is time to see us again.",
author: {
name: "Dr. Nadia Petrov",
role: "Physiotherapist, Willow Street Physio"
},
date: "2026-09-24",
readingTime: "4 min read",
tags: [
"Knees",
"Hiking"
],
cover: "https://images.unsplash.com/photo-1602684154647-eb1e2a9fd92e?w=1600&q=80",
coverAlt: "A hiker seen from behind, orange beanie and backpack, facing a mountain lake",
body: [
{
type: "paragraph",
text: "Most knee injuries we see at Willow Street Physio heal well, but the trail is where people come back too fast. Here is the six-week plan we give our hikers, and what you can do at home without any special gear."
},
{
type: "heading",
text: "Weeks 1 and 2: calm the knee down"
}
],
related: [
{
id: "r1",
title: "Mobility on the mat: twenty minutes for stiff hips",
excerpt: "The class we run every Tuesday, written down.",
image: "https://images.unsplash.com/photo-1787647089977-3db9bf565328?w=1600&q=80",
alt: "People doing yoga on mats in a room with a colorful wall",
section: "Exercises"
},
{
id: "r2",
title: "Snow and steep ground: preparing your ankles for winter",
excerpt: "Balance work that takes five minutes a day.",
image: "https://images.unsplash.com/photo-1600100315778-850119b19220?w=1600&q=80",
alt: "A walker in black pants and brown shoes in front of snowy mountains",
section: "Prevention"
}
],
open: "article"
}
</script>

<template>
<ArticleLayoutProse v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
breadcrumbBreadcrumb[]Datathe path to this article, from the home page; the last item is the article itself
title*stringWordsthe article’s title
standfirststringWordsthe one or two sentences under the title that say what the article is about
authorAuthorDatathe writer, as the merchant named them; none: no byline
datestringWordsthe publication date: an ISO date (2026-10-02) is written out in the visitor’s language, other text is shown as is
readingTimestringWordsas the merchant states it ("7 min read")
tagsstring[]Wordsa topic
coverstringPicturea picture: a root-relative path (/media/…) or an absolute URL
coverAltstringWordswhat the cover shows
body*(Body | Body | Body | Body | Body | Body | Body | Body | Body)[]the article, as typed blocks: paragraph, heading, quote, image, list, facts, table, note, step
summarySummary[]a strip of key facts at the top of a how-to
relatedRelated[]Datathe next articles to read: two or three
openstringActionthe action that opens one related article; the article is its record
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Breadcrumb breadcrumb[] · 4 props
PropTypeDescription
label*stringWordsthe link’s words, e.g. "See the collection"
actionstringActiona named action of the page
recordRecord<string, unknown>Datathe record the action applies to, passed to the host with it, if any
urlstringDesignan address outside the app
Author 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
Summary summary[] · 2 props
PropTypeDescription
label*stringWords("Duration", "Equipment")
value*stringWordsits value
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
Options options · 2 props
PropTypeDescription
measure'narrow' | 'normal' | 'wide'how wide the text column is: narrow, normal or wide
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
  • No motion; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: breadcrumb[], open
  • Reads articles from your app

A article section, for article pages; it uses @lucide/vue, @vueuse/core.

More article blocks

  • End stacked: the usual close of a long read: topics, the writer, one newsletter row, then up to three related stories side by side.
  • 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.
  • List cards: the entries as cards in a grid: a list to scan, each entry short and with a picture.
  • List numbered: a numbered article read top to bottom: a number in the margin, the entry, an optional picture beside it.
  • List ranked: big numerals and pictures alternating sides: a ranking or a countdown the visitor reads with pleasure.
  • Long guide toc rail: a long guide with several headings: a sticky "on this page" rail with the article’s dates beside the text.

All 29 article blocks