Metrics story chart — Case studies block
Procase-studies-metrics-story-chart · for home, landing, about pages
Metrics story chart
A few figures as rows beside a chart of the merchant’s own series over time; 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/case-studies-metrics-story-chartUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import CaseStudiesMetricsStoryChart from '@/components/trame/blocks/case-studies/case-studies-metrics-story-chart.vue'
const props = {
heading: "The shop in numbers",
lead: "Figures kept up to date by the team, each with its period.",
items: [
{
value: "12,400",
label: "orders delivered since 2019",
icon: "package"
},
{
value: "4.8/5",
label: "average customer rating",
note: "from 312 published reviews",
icon: "star"
}
],
source: "Figures as of December 31, 2025, based on our orders and the reviews published on the shop.",
sourceHref: "about",
series: [
{
label: "2020",
value: 640
},
{
label: "2021",
value: 1180
}
],
options: {
seriesTitle: "Orders delivered per year",
count: false
}
}
</script>
<template>
<CaseStudiesMetricsStoryChart v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| heading | string | Wordswhat these figures say, in a few words |
| lead | string | Wordsone sentence of context |
| items | Item[] | the items shown, in order |
| groups | Group[] | ledger: figures grouped by topic |
| series* | Sery[] | Datastory: the merchant’s own series (a month, a year and its figure), never generated |
| source | string | Wordsthe footnote: source, period and method ("Figures at 31 December 2025, from our orders") |
| sourceHref | string | Actionwhere the source or the report is read |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Item items[] · 6 props
| Prop | Type | Description |
|---|---|---|
| value* | string | Wordsthe figure exactly as the merchant writes it ("12,400", "€1.2M", "4.8/5"), with its unit |
| label* | string | Wordswhat it counts ("orders delivered"), with its period if it has one ("since 2019") |
| note | string | Wordsa precision under the label ("returns excluded"): never a claim the merchant did not make |
| icon | 'users' | 'package' | 'calendar' | 'star' | 'heart' | 'leaf' | 'truck' | 'map-pin' | 'award' | 'recycle' | 'clock' | 'shield-check' | the icon shown with it, from the block’s set |
| trend | string | Wordsa change the merchant measured ("+8% over a year"), only with a real series behind it |
| series | number[] | the merchant’s own values over time, drawn as a small line (cards) |
Group groups[] · 2 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe topic ("Delivery", "Materials") |
| items* | Item[] | the group’s items, in order |
Item groups[].items[] · 6 props
| Prop | Type | Description |
|---|---|---|
| value* | string | Wordsthe figure exactly as the merchant writes it ("12,400", "€1.2M", "4.8/5"), with its unit |
| label* | string | Wordswhat it counts ("orders delivered"), with its period if it has one ("since 2019") |
| note | string | Wordsa precision under the label ("returns excluded"): never a claim the merchant did not make |
| icon | 'users' | 'package' | 'calendar' | 'star' | 'heart' | 'leaf' | 'truck' | 'map-pin' | 'award' | 'recycle' | 'clock' | 'shield-check' | the icon shown with it, from the block’s set |
| trend | string | Wordsa change the merchant measured ("+8% over a year"), only with a real series behind it |
| series | number[] | the merchant’s own values over time, drawn as a small line (cards) |
Sery series[] · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the figure is |
| value* | number | the figure at this point |
Options options · 3 props
| Prop | Type | Description |
|---|---|---|
| count | boolean | let each figure count up to its given value once, when it comes into view (never to another value; on by default, false keeps every figure still) |
| seriesTitle | string | Wordsstory: what the chart shows ("Orders delivered per year") |
| 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 |
| Link | your router’s link component |
| 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
- Asks your app through actions:
sourceHref - Reads
seriesfrom your app
A case studies section, for home, landing, about pages; it uses clsx, motion, tailwind-merge.
More case studies blocks
- Before after: two panels, what was wrong and what is now, then the figures in a strip.
- Featured plus list: one featured story and a rail of the other stories, each with its main figure.
- Featured: one story told large: the words at the left, its three figures in a column, the customer’s quote under.
- Goals table: target against outcome with a status for each, a miss shown as plainly as a success.
- Proof by segment logos and quote: a switch of customer kinds on top, then the chosen kind’s logos in a quiet ruled row and its first quote told large, the others small beside it: a product sold to a few distinct kinds of customer, one voice per kind carrying the proof; the merchant’s own logos and quotes only.
- Proof by segment quote cards: the heading and a vertical list of customer kinds at the start, the chosen kind’s quotes as one to three cards with their faces beside it, its logos small under them: kinds of customer with several voices each and real portraits; the merchant’s own logos and quotes only.
- Quotes and results: two to four customers whose words and figures both matter, on a landing page: their quotes in a row of cards, then one picture card per story with its first figure (the merchant’s own quotes and results only).
- Study cards feature rows: two to four deep stories as wide alternating rows, the cover beside the headline and all the results as a strip of figures: a few customers told at length.