Skip to content
Klarhimmel UI

Stats, figures inline

Stats, figures inline previewStats, figures inline preview

Install

npx shadcn add https://ui.klarhimmel.com/r/stats-figures-inline.json
DetailsAbout, usage, props and more

A dark band with a large heading and a small note, then item names in large italic display type flowing inline like a sentence, each followed by a small figure; on a…

Import

Import

import Block from '@/components/klarhimmel/blocks/stats-figures-inline';
Also called
  • stats/figures-inline
About
A dark band with a large heading and a small note, then item names in large italic display type flowing inline like a sentence, each followed by a small figure; on a phone the names wrap onto their own lines.
Category
A few numbers that prove the point. New project? Set it up once: /get-started/installation.

Notes

When to use it

A dark band with a large heading and a small note, then item names in large italic display type flowing inline like a sentence, each followed by a small figure. Use stats-row for a clean grid of numbers.

Writing for it

- Pair each name with a figure that means the same kind of thing, such as a count or a share. - Say in the note what the figure beside each name means and over what period. - Choose names that read well together as a run of words, since they sit inline.

Watch out for

On a phone the names wrap onto their own lines and the sentence feel is lost. A long list of names also runs past the band, so keep it short.

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 StatsFiguresInline from '@/components/klarhimmel/blocks/stats-figures-inline';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <StatsFiguresInline props={{
          "title": "Say what the figures below measure",
          "description": "Say in one sentence what the figure beside each name means and over what period.",
          "items": [
            {
              "name": "Name the first item",
              "figure": "Its share"
            },
            {
              "name": "Name the second item",
              "figure": "Its share"
            },
            {
              "name": "Name the third item",
              "figure": "Its share"
            },
            {
              "name": "Name the fourth item",
              "figure": "Its share"
            }
          ]
        }} />
      </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 figures below measure'Text, up to 80 characters.
descriptionstring'Say in one sentence what the figure…'Text, up to 200 characters.
items{ name, figure }[]4 itemsList of 2 to 12. Each item: name, figure.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.