Accordion — Case studies block

Free

case-studies-accordion · for home, landing, portfolio pages

Accordion

Four to eight customers listed by name with their first figure, the visitor opening the one that resembles them: the open row shows the portrait, their words and the other figures (the merchant’s own quotes and results 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-accordion

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import CaseStudiesAccordion from '@/components/trame/blocks/case-studies/case-studies-accordion.vue'

const props = {
heading: "They did it with us",
lead: "Stories told with our customers’ consent, and their numbers.",
stories: [
{
customer: "Maison des Champs",
headline: "A neighborhood grocer that doubled its bulk aisle in a year",
summary: "After a three-month trial with our deposit containers, the grocer rebuilt its aisle around bulk and kept the same team.",
challenge: "The bulk aisle took up six feet of shelving and produced a lot of waste because of unsuitable containers.",
solution: "Deposit containers, a weekly restock and new signage designed with the store team.",
outcome: "The aisle now runs twenty feet and keeps itself stocked between deliveries.",
results: [
{
value: "×2",
label: "more bulk products on offer",
note: "from 40 to 80 products, between January and December 2025"
},
{
value: "−35%",
label: "less waste in the aisle",
note: "measured by the grocer over twelve months"
}
],
quote: "We stopped throwing products away, and our customers come back with their jars without us having to ask.",
author: "Claire, manager",
image: "https://images.unsplash.com/photo-1542838132-92c53300491e?w=1600&q=80",
alt: "The fresh fruit and vegetable aisle of a store",
href: "case",
record: {
id: "maison-des-champs"
},
tags: [
"Grocery",
"Bulk"
],
before: [
"Six feet of bulk, often out of stock",
"Containers thrown away after a single use"
],
after: [
"Twenty feet of bulk, restocked every week",
"Deposit containers, reused"
],
goals: [
{
goal: "Double the bulk products",
target: "80 products",
outcome: "80 products",
status: "met"
},
{
goal: "Cut waste in half",
target: "−50%",
outcome: "−35%",
status: "partial"
}
],
note: "Figures provided by the grocer, for January 1 to December 31, 2025."
},
{
customer: "Quay Bookshop",
headline: "A reading nook that keeps visitors twenty minutes longer",
results: [
{
value: "+20 min",
label: "more time spent in store"
},
{
value: "12",
label: "events hosted in 2025"
}
],
href: "case",
tags: [
"Bookshop"
],
image: "https://images.unsplash.com/photo-1700308234428-c619d7408fbd?w=1600&q=80"
}
]
}
</script>

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

Props

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

PropTypeDescription
headingstringWordsthe section’s title ("They did it with us")
leadstringWordsone sentence of context
stories*Story[]the customer stories, each with its results
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Story stories[] · 19 props
PropTypeDescription
customer*stringWordsthe customer’s name, with their agreement
logostringPicturethe customer’s logo, as they gave it
headline*stringWordsthe story in one sentence
summarystringWordstwo or three sentences of what happened
challengestringWordsthree-columns: the situation before
solutionstringWordsthree-columns: what was done
outcomestringWordsthree-columns: the result in words, next to the figures
results*Result[]the story’s measured results
quotestringWordsthe customer’s words, exactly, with their consent
authorstringWordswho said it ("Claire, head of purchasing")
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordsthe picture’s description, when it shows something the words do not
hrefstringActionthe full story
recordRecord<string, unknown>Datathe record the action opens (an article), if any
tagsstring[]Wordsup to four short tags, e.g. the sector
beforestring[]Wordsbefore-after: what was wrong, one line each
afterstring[]Wordsbefore-after: what is now, one line each
goalsGoal[]goals-table: target against outcome
notestringWordsperiod and method of the figures, under the story
Result stories[].results[] · 3 props
PropTypeDescription
value*stringWordsthe customer’s own figure, as they gave it ("−32%", "12 → 30 stockists")
label*stringWordswhat it measures, with its period ("fewer returns over six months")
notestringWordshow it was measured, if the customer said
Goal stories[].goals[] · 4 props
PropTypeDescription
goal*stringWordswhat was aimed at
targetstringWordsthe target, as set
outcome*stringWordswhat was reached, exactly
status*'met' | 'partial' | 'missed'the merchant states it, a miss included
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
asseta picture’s address as your app serves it
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: stories[].href

A case studies section, for home, landing, portfolio pages; it uses @lucide/vue, clsx, motion, tailwind-merge.

Built with

The components this block is made of; each one installs on its own too.

More case studies blocks

  • Metrics story chart: a few figures as rows beside a chart of the merchant’s own series over time; the merchant’s own only.
  • 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.
  • 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.
  • Study cards figure cover: cards whose cover carries the customer’s first figure very large, the headline and a second result under it: when the results are the pitch (the customer’s own figures only).
  • Study cards figure split: two to twelve stories as wide split cards in a rail, the customer and their first figure huge on one half and the cover on the other, the next card peeking: when one number per customer is the pitch and the covers are good (the customer’s own figures only).
  • Study cards grid previews: two to twelve stories as cards with a cover, a tag and two results: when there are several customers to show, not one to tell.
  • Study cards overlay mosaic: four to six stories as a bento of covers, the first one tall, the text over each cover: a more editorial proof section.

All 20 case studies blocks