Skip to content

ComparisonTable

Experimental

Compares 2 to 5 things side by side. On a small screen, it becomes stacked cards.

Also known as compare table, feature comparison, pricing table

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Three plans

Plan comparison

  • Free

    Seats
    1
    History
    7 days
  • TeamRecommended

    Seats
    10
    History
    1 year
  • Scale

    Seats
    Unlimited
    History
    Unlimited

Make the window narrow to see the stacked cards.

When to use it

Lines up two to five options against the same features so people can compare them at a glance. On a small screen it becomes one card per option, because wide tables are hard to read on a phone.

Made of: Caption · Item headings · Feature names · Cells · Badge

Use it for

  • Comparing plans, models or products on the same features.
  • Pointing out a recommended option among a few choices, with a badge.

Not for

  • The numbers behind a chart: use DataTable.
  • Picking one of a few options inside a control: use SegmentedControl.
  • Laying out a page in columns: use Grid.

Do and avoid

Compare plans

  • Basic

    Monthly fee
    $0
    Storage
    5 GB
  • PlusMost picked

    Monthly fee
    $8
    Storage
    100 GB
Do. Two plans, the same rows, and every cell filled in.

Compare plans

  • Basic

    Monthly fee
    $0
    Storage
  • PlusMost picked

    Monthly fee
    $8
    Storage
    100 GB
Avoid. Empty cells leave people guessing if a feature is missing.

Do

  • Compare two to five items on the same features.
  • Keep cell text short.
  • Mark a recommendation with the badge text.
  • Write a caption that says what is compared.

Avoid

  • Do not use a table to lay out a page.
  • Do not compare more than five items.
  • Do not show a winner with color alone.
  • Do not leave cells empty. Write a dash or a reason.

On a phone

  • Below 600px wide it switches from a table to one card per item, with each attribute in a two-column list, so nothing scrolls sideways.
  • From 600px wide it is a real table that scrolls sideways inside its box if it is wider than the screen.
  • Only one of the two forms is shown at a time, so screen readers do not read the data twice.

Seen in products

  • Our research table lists this as a proper table with headings.
  • W3C guidance on complex images says not to rely on color alone.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started