Stats, columns


Install
npx shadcn add https://ui.klarhimmel.com/r/stats-columns.jsonDetailsAbout, usage, props and more
A heading on the left with a short note on the right, then three to eight vertical bars on a baseline, each with its value above and its label under.
Import
Import
- stats/columns
- About
- A heading on the left with a short note on the right, then three to eight vertical bars on a baseline, each with its value above and its label under.
- Category
- A few numbers that prove the point. New project? Set it up once: /get-started/installation.
Notes
When to use it
A heading on the left with a short note on the right, then three to eight vertical bars on a baseline, each with its value above and its label under. Use stats-bars for a ranked list and stats-row for plain numbers.
Writing for it
- Write each value as text, since the first number in it sets the bar height against the largest in the list. - Label each bar with its period or category, such as a weekday, so the row reads like a small chart. - Use the note for the source or the time span, and keep it to a sentence.
Watch out for
Bars scale to the largest value, so one outlier flattens the rest. On a phone the bars keep their row but get narrower, so eight bars with long labels crowd.
Pairs well with
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
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.
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | 'Say what the bars measure over time' | Text, up to 80 characters. |
note | string | 'Say in a few words the period and t…' | Text, up to 80 characters. |
items | { label, value }[] | 7 items | List of 3 to 8. Each item: label, value. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |