Chapter strip — Blog block

Pro

blog-chapter-strip · for journal, article pages

Chapter strip

A slim strip of chapters with the current one marked: inside an article that belongs to a series

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-chapter-strip

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import BlogChapterStrip from '@/components/trame/blocks/blog/blog-chapter-strip.vue'

const props = {
title: "In this series",
steps: [
{
id: "s1",
title: "Why a bag lasts, or doesn’t",
excerpt: "The three places where a bag gives way, and how to spot them before you buy.",
minutes: 6
},
{
id: "s2",
title: "How we choose our leathers",
excerpt: "A visit to the tannery and the criteria we never compromise on.",
minutes: 7
}
],
status: "In progress",
current: "s3"
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe block’s title ("Where to start", "The series on leathers")
leadstringWordsone sentence under the title
steps*Step[]Datathe articles in reading order
statusstringWordswhere the series stands, as the merchant says it ("Full", "In progress")
current*stringDesignthe id of the step being read
openstringActionthe action that opens one step; the article is its record
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Step steps[] · 10 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"
minutesnumberthe reading time in minutes: the block adds them up, it never guesses them
Author steps[].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
showTotalbooleanwhether the number of chapters is shown
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: open
  • Reads articles from your app

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

More blog blocks

  • Article list featured: the newest article told large beside the rest as a compact list: a journal’s front page.
  • Article list rows: a dense index of articles with their dates, readable without any picture: a journal’s archive page.
  • Article list scroll row: five or more articles in one swipeable row, ending on the entry to all of them: a home page.
  • Article list timeline: the articles set on a rail, grouped by the month of their date: an archive one reads season by season.
  • Front page centered lead: a brand journal: a centred lead under a wide cover, then a short row of secondary stories with small thumbnails.
  • Front page feature stack: a travel, culture or lifestyle magazine home: the lead and up to four stories as alternating picture-and-text bands, each with a kicker and a deck.
  • Front page issue cover: a periodic journal: the issue’s name very large, the lead story and a numbered table of contents, no picture required.
  • Front page lead trio: a lead story over its cover, then three stories of equal weight below it.

All 35 blog blocks