Verdict table — Article block

Pro

article-verdict-table · for article, product, home pages

Verdict table

Several options judged one by one, a call and a reason for each: a buying guide or an extras advice

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-table

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import ArticleVerdictTable from '@/components/trame/blocks/article/article-verdict-table.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>
<ArticleVerdictTable v-bind="props" />
</template>

Props

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

PropTypeDescription
title*stringWordsthe question the verdict answers ("Which colour to choose?")
leadstringWordsone or two sentences saying how the merchant judged
items*Item[]Datathe options with the merchant’s call on each, best first
footnotestringWordswhere a figure comes from, or what the judgement leaves out
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Item items[] · 7 props
PropTypeDescription
name*stringWordsthe option judged
verdict*stringWordsthe merchant’s call in one word or two ("Buy", "Wait", "Skip")
tone'good' | 'neutral' | 'bad'how the call reads: good, in between, or against
reasonstringWordswhy, in a sentence or two
pricenumberits price in cents
rowsRow[]the item’s rows, in order
caveatsstring[]Wordsone thing to know before choosing it
Row items[].rows[] · 3 props
PropTypeDescription
label*stringWordswhat the line is ("Watch first", "Repairs over 5 years")
value*stringWordsits value as the merchant wrote it ("€89", "None")
totalbooleanthe closing line of a ledger
Options options · 2 props
PropTypeDescription
eyebrowstringWordswhat kind of advice it is ("Our view")
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
moneyformats a price, given in cents
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

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.

All 29 article blocks