Writers index grid — Blog block

Pro

blog-writers-index-grid · for journal pages

Writers index grid

Every writer of the journal in a grid of portraits, beat and a line of bio: the journal’s "who writes" page

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-writers-index-grid

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import BlogWritersIndexGrid from '@/components/trame/blocks/blog/blog-writers-index-grid.vue'

const props = {
title: "The journal’s writers",
authors: [
{
id: "camille",
name: "Camille Roussel",
role: "Writer, materials and care",
avatar: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=1600&q=80",
bio: "She has written about materials since the first collection and spends her weeks between the workshop and the tannery.",
articleCount: 14,
links: [
{
label: "Her notebook",
url: "https://example.com/camille"
}
]
},
{
id: "ines",
name: "Ivy Marchand",
role: "Workshop manager",
avatar: "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=1600&q=80",
bio: "A seamstress by training, she writes about the workshop’s craft and its repairs.",
articleCount: 9
}
]
}
</script>

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

Props

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

PropTypeDescription
titlestringWordsthe block’s title ("Written by", "The journal’s writers"), if it needs one
authors*Author[]Datathe writers of the journal
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
Author authors[] · 9 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 merchant or the writer chose: never written by the shop for them
articleCountnumberhow many articles the shop has published by them: counted by the shop
linksLink[]their own pages: a site, a profile
Link authors[].links[] · 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
Options options · 2 props
PropTypeDescription
showBiobooleanwhether each writer’s bio 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
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: authors[].links[], openAuthor
  • Reads authors, articles from your app

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

More blog blocks

  • Series shelf cards: one card per series with its parts, total time and status: a journal that publishes in series.
  • Topic index guide cards: picture cards for how-tos, each with its practical line: a journal of guides and tutorials.
  • Topic index tiles icon: tiles with an icon, a count and a one-sentence scope: a journal with a handful of clear themes.
  • Topic rails cards rail: a swipeable row of picture cards for each topic, with its "see all": a journal with strong covers.
  • Topic rails lead per topic: each topic opens on one large story, the others in a row beside it: a magazine with sections.
  • Topic rails numbered: each topic as a numbered list, in the order the journal ranks it: a curated "best of" (the journal’s own ranking only).
  • Topic rails text rail: the topics as columns of kickers and headlines, no picture: a news-like or archive home.
  • Topic starts rows: hairline rows, each theme with its count and the article to begin with: a deep journal read without pictures.

All 35 blog blocks