Progress figures columns — Stats block

Pro

stats-progress-figures-columns · for about, product, sustainability pages

Progress figures columns

The same measures at two dates in two columns: what improved, and what went backwards; the merchant’s own only.

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/stats-progress-figures-columns

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StatsProgressFiguresColumns from '@/components/trame/blocks/stats/stats-progress-figures-columns.vue'

const props = {
title: "What changed in four years",
rows: [
{
label: "Vegetable-tanned leather",
before: "41%",
value: "86%"
},
{
label: "Plastic-free parcels",
before: "10%",
value: "100%"
}
],
periods: {
before: "2022",
after: "2025"
},
source: "Workshop accounts, fiscal year 2025, reviewed by our CPA",
asOf: "As of December 31, 2025",
footnote: "Updated once a year, in January."
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe claim these books prove ("Where each euro of a bag goes")
leadstringWordswhat the figures cover and why the merchant publishes them
rows*Row[]Datathe merchant’s own lines: three at least
periods*Periodsthe two dates compared
source*stringWordswhere the figures come from ("Workshop accounts, 2025 financial year, certified by our accountant")
asOf*stringWordsthe date of the figures, as the merchant wrote it ("At 31 December 2025")
footnotestringWordshow often it is updated, or a limit of the figures
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Row rows[] · 6 props
PropTypeDescription
label*stringWordswhat the line counts ("Materials", "Workshop", "Shop margin")
amountnumberan amount in cents
sharenumberits share of the whole, in percent
valuestringWordsa figure that is not money, as the merchant writes it ("214 repairs", "3 rooms")
beforestringWordsthe same measure at the first date, for then-now ("41%")
notestringWordsone short line of explanation
Periods periods · 2 props
PropTypeDescription
before*stringWordsthe first date ("2022")
after*stringWordsthe second date ("2026")
Options options · 2 props
PropTypeDescription
currencystringDesignISO 4217, EUR by default
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 stats section, for about, product, sustainability pages; it uses clsx, motion, tailwind-merge.

More stats blocks

  • Impact ledger breakdown bar: one stacked bar of shares with a legend and an explanation per share: what happens to returns, where the money goes.
  • Impact ledger commitments timeline: dated promises with the merchant’s own status on each: commitments kept, ongoing or late.
  • Impact ledger rules grid: numbered cards saying how the figures are counted: gives credibility to the numbers above it.
  • Impact ledger: rows of label and value grouped by topic with a method footnote: carbon, repair, donations, sourcing figures.
  • Listening figures bars: Published figures and ranked shares with a required measurement period; the merchant’s own only.
  • Metric cards spotlight: one figure that matters more than the others, set very large on a tinted panel, the rest as ruled rows beside it and the series as labelled bars under them: when the first figure carries the story; the merchant’s own only.
  • Metric cards: each figure on its own card with its precision, its change and a small line of its series; the merchant’s own only.
  • Proof figures tiles: up to three compact boxes (rating, count, one more figure) under an action: when numbers carry the page; the merchant’s own only.

All 20 stats blocks