# Comparison, us versus them

- **[Sections](/blocks/)**
- **[Comparison](/blocks/comparison/)**
- **Comparison, us versus them**

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

- **CLI**

  ```
  npx shadcn add https://ui.klarhimmel.com/r/comparison-table.json
  ```
- **Import**

  ```
  import Block from '@/components/klarhimmel/blocks/comparison-table';
  ```

Also called

- 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.

## Pairs well with

- **[Pricing, comparison table](/blocks/pricing/comparison)**
- **[Comparison, who it is for](/blocks/comparison/cards)**
- **[Call to action, card](/blocks/cta/card)**

## 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 ComparisonTable from '@/components/klarhimmel/blocks/comparison-table';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <ComparisonTable props={{
          "eyebrow": "Name the topic",
          "title": "Say how the options differ",
          "description": "Say in one or two sentences what the table compares and why it is honest.",
          "caption": "Say what is compared, so a screen reader can name the table.",
          "featureLabel": "Name the rows",
          "ours": "Our option",
          "others": [
            "First option",
            "Second option"
          ],
          "rows": [
            {
              "feature": "Name a first feature, in a line",
              "values": [
                "yes",
                "no",
                "yes"
              ]
            },
            {
              "feature": "Name a second feature, in a short line",
              "note": "Say what it means for them",
              "values": [
                "yes",
                "partial",
                "yes"
              ]
            },
            {
              "feature": "Name a third feature, in a line",
              "values": [
                "yes",
                "partial",
                "no"
              ]
            }
          ],
          "words": {
            "yes": "Included",
            "no": "Not included",
            "partial": "Partly"
          },
          "scrollHint": "Say how to reveal the other columns",
          "cta": {
            "label": "Main action",
            "href": "#trial"
          }
        }} />
      </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.

- **eyebrow**: Text, up to 60 characters.
- **title**: Text, up to 120 characters.
- **description**: Text, up to 300 characters.
- **caption**: Text, up to 80 characters.
- **featureLabel**: Text, up to 30 characters.
- **ours**: Text, up to 30 characters.
- **others**: List of 1 to 3.
- **rows**: List of 3 to 10. Each item: feature, note (optional), values.
- **words**: Fields: yes, no, partial.
- **scrollHint**: Text, up to 40 characters.
- **cta**: See the type.
- **headingLevel**: One of '1', '2'. Optional; empty is not rendered.

[Previous](/blocks/comparison/cards)

[Next](/blocks/download/apps)
