Impact ledger rules grid — Stats block

Pro

stats-impact-ledger-rules-grid · for about, home, landing pages

Impact ledger rules grid

Numbered cards saying how the figures are counted: gives credibility to the numbers above it

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-impact-ledger-rules-grid

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StatsImpactLedgerRulesGrid from '@/components/trame/blocks/stats/stats-impact-ledger-rules-grid.vue'

const props = {
heading: "Our impact, figure by figure",
lead: "What we measure, how, and what we haven’t reached yet.",
groups: [
{
title: "Shipping",
rows: [
{
label: "CO₂ emissions per parcel shipped",
value: "1.9 kg in 2025",
note: "Calculated from our carrier’s records, excluding returns."
},
{
label: "Parcels delivered by cargo bike",
value: "38% in 2025"
}
]
},
{
title: "Repairs",
rows: [
{
label: "Pieces repaired in the workshop",
value: "240 in 2025"
},
{
label: "Average repair time",
value: "9 days",
note: "From drop-off to shipping, across 2025."
}
]
}
],
method: "Period: calendar year 2025. Scope: the Portland workshop and shipments within the US.",
reportHref: "about",
shares: [
{
label: "Put back on sale as is",
percent: 54,
text: "Checked in the workshop, then back on the shelf labeled “second life.”"
},
{
label: "Repaired, then resold",
percent: 31,
text: "A seam, a strap or a lining redone."
}
],
rules: [
{
title: "One repaired piece",
text: "Counts once, when shipped, even if it needed two repairs."
},
{
title: "One cargo-bike parcel",
text: "Counts when the whole delivery is made by bike, not just the last mile."
}
]
}
</script>

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

Props

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

PropTypeDescription
headingstringWordswhat is reported ("Our impact, in verifiable figures")
leadstringWordsone sentence of context
groupsGroup[]the groups shown, in order
sharesShare[]breakdown-bar: the parts of one whole
rulesRule[]rules-grid: how the figures are counted
methodstringWordsthe footnote: period, scope and method of the figures, as the merchant states them (the block adds no "certified" or "audited")
reportHrefstringActionwhere the full report is read
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Group groups[] · 2 props
PropTypeDescription
titlestringWordsthe topic ("Transport", "Materials")
rows*Row[]the group’s rows, in order
Row groups[].rows[] · 6 props
PropTypeDescription
label*stringWordswhat is measured or promised ("CO₂ emissions per parcel")
value*stringWordsthe figure exactly as the merchant writes it, with its unit and period ("1.9 kg in 2024")
datestringWordscommitments-timeline: when it was promised or reached, as written ("by 2027")
statusstringWordswhere it stands, in the merchant’s own word ("Held", "In progress", "Late")
tone'done' | 'ongoing' | 'late'the colour of the status: only what the merchant states
notestringWordshow it was measured, or a precision: the method belongs here
Share shares[] · 3 props
PropTypeDescription
label*stringWordsone part of the whole ("Repaired and resold")
percent*numberDatathe merchant’s own share, in percent
textstringWordswhat this part means
Rule rules[] · 2 props
PropTypeDescription
title*stringWordsone counting rule ("What counts as repaired")
text*stringWordsthe rule, as the merchant applies it
Options options · 1 props
PropTypeDescription
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: reportHref

A stats section, for about, home, landing pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, motion, reka-ui, tailwind-merge.

More stats blocks

  • Benchmarks funnel: Ordered step values with a reference marker, without inferred conversion rates; the merchant’s own only.
  • Benchmarks table: A compact comparison table with the current column highlighted; the merchant’s own only.
  • Benchmarks trend: Two measured series plotted in order with a full data table; the merchant’s own only.
  • Brand figures facts band: the story centred above a full-width band of large facts, the values as a line under it: when the figures are the proof.
  • 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.
  • Progress figures columns: the same measures at two dates in two columns: what improved, and what went backwards; the merchant’s own only.

All 20 stats blocks