Metrics story chart — Case studies block

Pro

case-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-chart

Usage

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.

PropTypeDescription
headingstringWordswhat these figures say, in a few words
leadstringWordsone sentence of context
itemsItem[]the items shown, in order
groupsGroup[]ledger: figures grouped by topic
series*Sery[]Datastory: the merchant’s own series (a month, a year and its figure), never generated
sourcestringWordsthe footnote: source, period and method ("Figures at 31 December 2025, from our orders")
sourceHrefstringActionwhere the source or the report is read
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Item items[] · 6 props
PropTypeDescription
value*stringWordsthe figure exactly as the merchant writes it ("12,400", "€1.2M", "4.8/5"), with its unit
label*stringWordswhat it counts ("orders delivered"), with its period if it has one ("since 2019")
notestringWordsa 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
trendstringWordsa change the merchant measured ("+8% over a year"), only with a real series behind it
seriesnumber[]the merchant’s own values over time, drawn as a small line (cards)
Group groups[] · 2 props
PropTypeDescription
title*stringWordsthe topic ("Delivery", "Materials")
items*Item[]the group’s items, in order
Item groups[].items[] · 6 props
PropTypeDescription
value*stringWordsthe figure exactly as the merchant writes it ("12,400", "€1.2M", "4.8/5"), with its unit
label*stringWordswhat it counts ("orders delivered"), with its period if it has one ("since 2019")
notestringWordsa 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
trendstringWordsa change the merchant measured ("+8% over a year"), only with a real series behind it
seriesnumber[]the merchant’s own values over time, drawn as a small line (cards)
Sery series[] · 2 props
PropTypeDescription
label*stringWordswhat the figure is
value*numberthe figure at this point
Options options · 3 props
PropTypeDescription
countbooleanlet 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)
seriesTitlestringWordsstory: what the chart shows ("Orders delivered per year")
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: sourceHref
  • Reads series from 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.

All 20 case studies blocks