Skip to content
Klarhimmel UI

Stats, accent band

Stats, accent band previewStats, accent band preview

Install

npx shadcn add @klarhimmel/stats-band
DetailsAbout, usage, props and more

An edge-to-edge band in the accent colour: a short statement on the left and three or four big figures divided by hairlines on the right.

Import

Import

import Block from '@/components/klarhimmel/blocks/stats-band';
Also called
  • stats/band
About
An edge-to-edge band in the accent colour: a short statement on the left and three or four big figures divided by hairlines on the right. Loud and brief; use it once, between two quiet sections.
Category
A few numbers that prove the point. New project? Set it up once: /get-started/installation.

Notes

When to use it

An edge-to-edge accent-colour band with a short statement and three or four large figures, to be used once between two quiet sections. For a calm row of figures stats-row is the better fit.

Writing for it

- The title is required and holds 100 characters; make it a sentence that the numbers prove, such as what the company has done so far. - Values are limited to 20 characters and drawn at display size, so '12 000' or '99.9%' works and '12 000 customers' does not. - Every item needs both a value and a label, up to 60 characters, because empty ones are dropped when the page is published.

Watch out for

The whole band is the accent colour, so a page with other filled accent areas close by will look crowded. It also has only three or four slots, and adding a second band on the same page loses the point of using one.

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 StatsBand from '@/components/klarhimmel/blocks/stats-band';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <StatsBand props={{
          "title": "Say what the numbers add up to",
          "description": "Say over what period and across whom the numbers count.",
          "items": [
            {
              "value": "00",
              "label": "Name the first count"
            },
            {
              "value": "00",
              "label": "Name the second count"
            },
            {
              "value": "00",
              "label": "Name the third count"
            },
            {
              "value": "0.0",
              "label": "Name the fourth measure"
            }
          ]
        }} />
      </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
titlestring'Say what the numbers add up to'Text, up to 100 characters.
descriptionstring'Say over what period and across who…'Text, up to 200 characters.
items{ value, label }[]4 itemsList of 3 to 6. Each item: value, label.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.