Benchmarks funnel — Stats block

Pro

stats-benchmarks-funnel · for landing, article pages

Benchmarks funnel

Ordered step values with a reference marker, without inferred conversion rates; 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-benchmarks-funnel

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StatsBenchmarksFunnel from '@/components/trame/blocks/stats/stats-benchmarks-funnel.vue'

const props = {
title: "Shorter without losing the meaning",
intro: "A comparison of the lengths of texts shown in this demo.",
referenceLabel: "Original label",
currentLabel: "Shortened label",
note: "Source: displayed labels, measured when demo.ts was written. Character count, spaces included. An editorial exercise; no customer performance metrics.",
metrics: [
{
label: "Detailed documentation → Documentation",
before: 22,
after: 13,
unit: "characters"
},
{
label: "Getting your bearings → Explore",
before: 21,
after: 7,
unit: "characters"
}
]
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe section’s heading
introstringWordsa sentence or two under the heading
metrics*Metric[]Datathe measured figures, each before and after
referenceLabel*stringWordsthe name of the reference figures, e.g. "Before"
currentLabel*stringWordsthe name of the new figures, e.g. "Now"
note*stringWordsSource, period, sample and method are required
ctaCtathe call to action: its words and the page action it runs
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Metric metrics[] · 4 props
PropTypeDescription
label*stringWordsthe metric’s name, as shown
before*numberDatathe figure before the change
after*numberDatathe figure after the change
unitstringWordsthe unit written after the figure
Cta cta · 2 props
PropTypeDescription
label*stringWordsthe words on the button or link
action*stringActiona named action of the page
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: cta
  • Reads rows from your app

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

More stats blocks

  • Band ledger: a report of figures grouped by topic with a footnote: impact, sourcing, or more than six figures; the merchant’s own only.
  • Band milestones: figures along a rule, one dot each, in the order given: a path of firsts, years and counts rather than a table; the merchant’s own only.
  • Band period tabs: the same figures told for several years or topics, the visitor switching between the groups with a segmented control instead of reading a ledger; the merchant’s own only.
  • Band strip: a slim line of three or four figures between two sections, quiet and fast to read; the merchant’s own only.
  • Band: a band in the inverse or brand mood: the title at the left, the figures in a divided row at the right; 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.
  • 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.

All 20 stats blocks