Skip to content
Klarhimmel UI

Case study, metrics

Case study, metrics previewCase study, metrics preview

Install

npx shadcn add @klarhimmel/case-study-metrics
DetailsAbout, usage, props and more

One customer story led by its numbers: headline and summary, a row of two to four big metrics, then a quote beside a photo and a link to the full story.

Import

Import

import Block from '@/components/klarhimmel/blocks/case-study-metrics';
Also called
  • case-study/metrics
Category
One customer story: the problem, the work, the result. New project? Set it up once: /get-started/installation.

Notes

When to use it

One customer story that opens with its numbers: a row of two to four big metrics, then a quote beside a photo. Pick case-study-story when the story has no figures to show, and case-study-card for several customers.

Writing for it

- Metric values hold 20 characters, so use '48%' or '2.1 h', not a phrase. The 80 character label under each says what the number counts. - The quote has 320 characters and is set large on wide containers. Take it from the customer and attach the name and the role, both required for the caption. - The summary (400 characters) sits beside the title and is optional, so use it for context the metrics do not give, like the size of the client.

Watch out for

With four metrics the numbers use the smaller title size so they fit, with two or three they are larger. Adding a fourth metric therefore changes how loud the row looks, not only how wide it is.

Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import CaseStudyMetrics from '@/components/klarhimmel/blocks/case-study-metrics';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <CaseStudyMetrics props={{
          "eyebrow": "Name the section",
          "client": "Name a client",
          "title": "Say what the client achieved, with a number, in a short line",
          "summary": "Say in two sentences what the client struggled with, what they changed and what it did. Name the first change, then the second.",
          "metrics": [
            {
              "value": "0.0x",
              "label": "Name the first result"
            },
            {
              "value": "00%",
              "label": "Name the second result"
            },
            {
              "value": "00 min",
              "label": "Name the third result"
            },
            {
              "value": "0.0",
              "label": "Name the fourth result"
            }
          ],
          "quote": "Quote the client, in their words, on what changed for them in practice.",
          "name": "Name a person",
          "role": "Their role, and the business",
          "media": {
            "src": "/pictures/photo-florist1.avif",
            "alt": "A flower shop window in a brick building"
          },
          "link": {
            "label": "Read about this case",
            "href": "/customers/client"
          }
        }} />
      </BlockSurface>
    </Theme>
  );
}

Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

PropTypeDefaultDescription
eyebrowstring'Name the section'Text, up to 60 characters.
clientstring'Name a client'Text, up to 60 characters.
titlestring'Say what the client achieved, with …'Text, up to 140 characters.
summarystring'Say in two sentences what the clien…'Text, up to 400 characters.
metrics{ value, label }[]4 itemsList of 2 to 4. Each item: value, label.
quotestring'Quote the client, in their words, o…'Text, up to 320 characters.
namestring'Name a person'Text, up to 60 characters.
rolestring'Their role, and the business'Text, up to 80 characters.
mediaMedia{…}See the type.
linkLink{…}See the type.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.