ReferenceComponents

comparison

Two to four things on the same rows, read side by side.

Side by side. comparison lines up two to four things — shoes, plans, hotels, phones — on the same rows, so "which is lighter" is answered by reading across one line rather than two lists.

Each row puts its label above the values, so a value has a whole column even with four things on a phone, and nothing scrolls sideways. Once the things' own header has scrolled away, their names stay pinned at the top while the rows go by.

Aero Glide 2$129Trail Circuit$149
Weight248 g296 g
Drop8 mm6 mm
Waterproof—

Re-rendered in the browser from the SDK’s own scales. Not a screenshot.

The best value, and the opinion

best_index marks the best value in a row, and only where the data makes it measurably best: the lowest price, the most storage, the lightest shoe. Which one the user should buy is an opinion, and an opinion goes in summary, under the table, in words.

kind: "check" rows hold "yes" or "no" and are drawn as ✓ and —.

When not to use it

Not for one thing's details, which is key_value. Not for many records sharing columns, which is table. It takes the place of the old plan_comparison: plans are items, features are check rows.

Props

Every block also carries type and a required fallback_text of 1 to 300 characters.

PropTypeRequiredConstraints
titlestringNoUp to 80 characters.
itemsarrayYes2 to 4 entries.
items[].titlestringYes1 to 60 characters.
items[].subtitlestringNoUp to 80 characters.
items[].image_urlstringNoNone
items[].pricestringNoUp to 30 characters.
items[].badgestringNoUp to 24 characters.
items[].actionactionNo{ kind: "reply", text } or { kind: "open_url", url } or { kind: "navigate", route } or { kind: "call", phone } or { kind: "copy", text } or { kind: "add_to_calendar", title, starts_at }. See Actions.
rowsarrayYes1 to 12 entries.
rows[].labelstringYes1 to 40 characters.
rows[].valuesstring[]Yes2 to 4 strings, up to 60 characters each.
rows[].best_indexintegerNo0 to 3.
rows[].kindtext | checkNoNone
summarystringNoUp to 200 characters.

On the wire

{
  "id": "blk_70",
  "type": "comparison",
  "fallback_text": "Aero Glide 2 is lighter; Trail Circuit is waterproof.",
  "props": {
    "items": [
      { "title": "Aero Glide 2", "price": "$129", "image_url": "https://…" },
      { "title": "Trail Circuit", "price": "$149", "image_url": "https://…" }
    ],
    "rows": [
      { "label": "Weight", "values": ["248 g", "296 g"], "best_index": 0 },
      { "label": "Drop", "values": ["8 mm", "6 mm"] },
      { "label": "Waterproof", "values": ["no", "yes"], "kind": "check" }
    ],
    "summary": "On the road the Aero Glide is lighter and softer; on wet trails the Trail Circuit grips."
  }
}

Accessibility

A real table: the things are column headers, each row's label its row header, and the best value is announced as the best.