Comparison, us versus them


Install
npx shadcn add https://ui.klarhimmel.com/r/comparison-table.jsonDetailsAbout, usage, props and more
A table comparing you with one to three alternatives, feature by feature. Each cell says Included, Not included or Partly in words beside its icon.
Import
Import
- comparison/table
- About
- A table comparing you with one to three alternatives, feature by feature. Each cell says Included, Not included or Partly in words beside its icon.
- Category
- How it differs from the alternatives: a table that says yes, no or partly in words. New project? Set it up once: /get-started/installation.
Notes
When to use it
A feature-by-feature table of you against one to three alternatives, for readers who are already comparing. If the honest answer depends on who the reader is, comparison-cards fits better.
Writing for it
- Each row gives one verdict for you, then one per alternative, in the order of the column names. A row with the wrong count of values is the usual mistake. - Verdicts are said in words beside the icon. Change the three words in the words field for another language instead of leaving the English ones. - The block takes three to ten rows. A note of 100 characters under a feature is the place to explain a partial.
Watch out for
On a narrow container the table scrolls sideways inside its own region, with a hint under it. Name the table in the caption, because that is what a screen reader announces first.
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 |
|---|---|---|---|
eyebrow | string | 'Name the topic' | Text, up to 60 characters. |
title | string | 'Say how the options differ' | Text, up to 120 characters. |
description | string | 'Say in one or two sentences what th…' | Text, up to 300 characters. |
caption | string | 'Say what is compared, so a screen r…' | Text, up to 80 characters. |
featureLabel | string | 'Name the rows' | Text, up to 30 characters. |
ours | string | 'Our option' | Text, up to 30 characters. |
others | string[] | 2 items | List of 1 to 3. |
rows | { feature, note, values }[] | 6 items | List of 3 to 10. Each item: feature, note (optional), values. |
words | { yes, no, partial } | {…} | Fields: yes, no, partial. |
scrollHint | string | 'Say how to reveal the other columns' | Text, up to 40 characters. |
cta | Link | {…} | See the type. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |