Verdict cost ledger — Article block
Proarticle-verdict-cost-ledger · for article, product, home pages
Verdict cost ledger
What an option really costs over time, as two receipts with the caveats beside them: buy once, repair, replace
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-verdict-cost-ledgerUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import ArticleVerdictCostLedger from '@/components/trame/blocks/article/article-verdict-cost-ledger.vue'
const props = {
title: "Which bag should you choose for everyday use?",
lead: "We carried each one for six months. Here’s our honest take.",
items: [
{
name: "Marais waxed canvas bag",
verdict: "Buy",
tone: "good",
price: 8900,
reason: "The best balance of durability and price in the range; the canvas develops a fine patina.",
rows: [
{
label: "Price today",
value: "$89"
},
{
label: "Repairs over 5 years",
value: "$0 to $15"
}
],
caveats: [
"The bottom isn’t waterproof if submerged."
]
},
{
name: "Canal full-grain leather bag",
verdict: "Wait",
tone: "neutral",
price: 21900,
reason: "Gorgeous, but the leather needs care that few people actually give it.",
rows: [
{
label: "Price today",
value: "$219"
},
{
label: "Care over 5 years",
value: "$30"
}
],
caveats: [
"Allow two weeks to break it in.",
"14 oz heavier."
]
}
],
footnote: "Repair costs are what our workshop charged last year.",
options: {
eyebrow: "Our take"
}
}
</script>
<template>
<ArticleVerdictCostLedger v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe question the verdict answers ("Which colour to choose?") |
| lead | string | Wordsone or two sentences saying how the merchant judged |
| items* | Item[] | Datathe options with the merchant’s call on each, best first |
| footnote | string | Wordswhere a figure comes from, or what the judgement leaves out |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Item items[] · 7 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe option judged |
| verdict* | string | Wordsthe merchant’s call in one word or two ("Buy", "Wait", "Skip") |
| tone | 'good' | 'neutral' | 'bad' | how the call reads: good, in between, or against |
| reason | string | Wordswhy, in a sentence or two |
| price | number | its price in cents |
| rows | Row[] | the item’s rows, in order |
| caveats | string[] | Wordsone thing to know before choosing it |
Row items[].rows[] · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the line is ("Watch first", "Repairs over 5 years") |
| value* | string | Wordsits value as the merchant wrote it ("€89", "None") |
| total | boolean | the closing line of a ledger |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordswhat kind of advice it is ("Our view") |
| 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 |
| money | formats a price, given in cents |
| 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
A article section, for article, product, home pages; it uses @lucide/vue, clsx, motion, tailwind-merge.
More article blocks
- 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.
- Reader desk accordion ask: questions that open onto their answer, the first one open: many questions, little room.
- Reader desk column case: numbered cases told in labelled columns (what happened, why, the lesson): repairs and lessons learnt.
- Reader desk field notes: short note cards with the place and the years of use: readers telling how they use what they bought.
- Reader desk inbox rows: the reader’s question on one side, the reply signed by a person on the other: an advice column.
- Story opener split: a single story told as a feature opener: its cover on one half, its words on the other.