Reader desk column case — Article block
Proarticle-reader-desk-column-case · for journal, article, product pages
Reader desk column case
Numbered cases told in labelled columns (what happened, why, the lesson): repairs and lessons learnt
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-column-caseUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import ArticleReaderDeskColumnCase from '@/components/trame/blocks/article/article-reader-desk-column-case.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>
<ArticleReaderDeskColumnCase v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe block’s title ("Your questions, our answers") |
| lead | string | Wordsone sentence under the title |
| items* | Item[] | Datareal messages from readers and the replies they got |
| footnote | string | Wordshow to write in and what to expect ("We answer by hand, within a week") |
| cta | Cta | the way to send a message |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Item items[] · 8 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | the item’s id |
| question* | string | Wordsthe reader’s question or note, as they wrote it (trimmed only with their consent) |
| answer | string | Wordsthe reply, as the answerer wrote it |
| asker | string | Wordswho wrote, as they agreed to be named ("Julie", "A reader from Nantes") |
| place | string | Wordswhere they write from ("Lyon") |
| note | string | Wordsa line about them that gives the note its weight ("Has used the bag for 6 years"), as they said it |
| answerer | Answerer | who replied |
| columns | Column[] | for column-case: the case told in labelled parts |
Answerer items[].answerer · 6 props
| Prop | Type | Description |
|---|---|---|
| id | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe person’s name |
| role | string | Wordstheir role or job title |
| company | string | Wordswhere they work |
| avatar | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| url | string | Designa page about them |
Column items[].columns[] · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Words("What happened", "Why", "The lesson") |
| text* | string | Wordswhat the case says under that label |
Cta cta · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe link’s words, e.g. "See the collection" |
| action | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action applies to, passed to the host with it, if any |
| url | string | Designan address outside the app |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| clampAnswers | boolean | false: shows the answers whole instead of cutting long ones |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a 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).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your 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:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too 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 cards: Equal excerpt cards for real extracts of linked articles only.
- 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.