Passage strip cards — Article block

Pro

article-passage-strip-cards · for home, journal pages

Passage strip cards

Equal excerpt cards for real extracts of linked articles only.

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-passage-strip-cards

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import ArticlePassageStripCards from '@/components/trame/blocks/article/article-passage-strip-cards.vue'

const props = {
title: "A few lines to open the journal",
passages: [
{
id: "argile",
title: "What clay teaches us",
text: "Before looking for the right shape, we learn to listen to the material.",
link: {
label: "Read the story",
action: "article"
}
},
{
id: "reparer",
title: "Keeping a record of repairs",
text: "A visible seam can tell a story that something new never could.",
link: {
label: "Read the story",
action: "article"
}
}
]
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe section’s heading
passages*Passage[]Dataarticles shown by a real extract, each with a link
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Passage passages[] · 11 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"
text*stringWordsa real extract of this article
link*Linkthe link: its words and the page action it runs
Author passages[].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
Link passages[].link · 3 props
PropTypeDescription
label*stringWordsthe words on the button or link
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action applies to, passed to the host with it, if any
Options options · 1 props
PropTypeDescription
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
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: passages[].link
  • Reads articles from your app

A article section, for home, journal pages; it uses @lucide/vue, clsx, motion, tailwind-merge.

More article blocks

  • Layout steps: a how-to: a strip of key facts, then numbered steps each with its picture.
  • 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.
  • Quiz all at once: every question in one column, the score at the end: a short quiz read like an article.
  • Quiz cards: questions as cards side by side: a light quiz of three to six questions that invites a try.
  • Quiz one by one: one question at a time with its progress: a focused quiz of five to ten questions.

All 29 article blocks