Reader desk field notes — Article block

Pro

article-reader-desk-field-notes · for journal, article, product pages

Reader desk field notes

Short note cards with the place and the years of use: readers telling how they use what they bought

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-reader-desk-field-notes

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import ArticleReaderDeskFieldNotes from '@/components/trame/blocks/article/article-reader-desk-field-notes.vue'

const props = {
title: "Your questions, our answers",
lead: "Real questions sent to the workshop, published with the permission of the people who asked them.",
items: [
{
id: "q1",
question: "My zipper has been sticking since this summer. Can I fix it myself?",
answer: "Nine times out of ten, it’s grains of sand or dust in the teeth. Brush them dry with an old toothbrush, then rub a little dry soap on the slider. If a tooth is bent, don’t force it: send us the bag and we’ll replace the zipper in the workshop.",
asker: "Julie",
place: "Portland",
answerer: {
name: "Ivy Marchand",
role: "Workshop manager",
avatar: "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=1600&q=80"
},
columns: [
{
label: "What happened",
text: "A zipper that sticks at the bottom after a summer at the beach."
},
{
label: "Why",
text: "Fine sand in the teeth, and a slider worn down by forcing it."
}
]
},
{
id: "q2",
question: "Can waxed canvas go in the washing machine?",
answer: "No: the heat and the drum damage the coating. A damp sponge and mild soap are all you need.",
asker: "A reader in Sacramento",
answerer: {
name: "Camille Roussel",
role: "Writer"
},
columns: [
{
label: "What happened",
text: "A bag put through the wash at 86 °F."
},
{
label: "Why",
text: "The coating cracked in the creases."
}
]
}
],
footnote: "Write to us: we answer by hand, usually within a week.",
cta: {
label: "Ask a question",
action: "contact"
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe block’s title ("Your questions, our answers")
leadstringWordsone sentence under the title
items*Item[]Datareal messages from readers and the replies they got
footnotestringWordshow to write in and what to expect ("We answer by hand, within a week")
ctaCtathe way to send a message
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Item items[] · 8 props
PropTypeDescription
id*string | numberthe item’s id
question*stringWordsthe reader’s question or note, as they wrote it (trimmed only with their consent)
answerstringWordsthe reply, as the answerer wrote it
askerstringWordswho wrote, as they agreed to be named ("Julie", "A reader from Nantes")
placestringWordswhere they write from ("Lyon")
notestringWordsa line about them that gives the note its weight ("Has used the bag for 6 years"), as they said it
answererAnswererwho replied
columnsColumn[]for column-case: the case told in labelled parts
Answerer items[].answerer · 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
Column items[].columns[] · 2 props
PropTypeDescription
label*stringWords("What happened", "Why", "The lesson")
text*stringWordswhat the case says under that label
Cta cta · 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
clampAnswersbooleanfalse: shows the answers whole instead of cutting long ones
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: cta

A article section, for journal, article, product pages; it uses @lucide/vue, class-variance-authority, clsx, motion, reka-ui, tailwind-merge.

More article blocks

  • Passage strip stacked big: One large opening extract and a quiet reading list, for real linked extracts only.
  • 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.
  • Story opener split: a single story told as a feature opener: its cover on one half, its words on the other.
  • Verdict cost ledger: what an option really costs over time, as two receipts with the caveats beside them: buy once, repair, replace.
  • Verdict table: several options judged one by one, a call and a reason for each: a buying guide or an extras advice.
  • Verdict twin cards: two options to weigh against each other, a few comparable lines on each: which colour, which size.

All 29 article blocks