Skip to content

comparison

Two or three options side by side, measured on the same two to five rows.

Use the comparison layout to set two or three options side by side and measure them on the same rows: you and a competitor, or the options of a decision. You write the options and rows in the frontmatter, mark which option wins each row, and can set the one you recommend on a panel under a badge.

Example

lookbook / comparison-before-afterOpen full deck
decks/lookbook/slides/comparison-before-after.mdxmdx
---
layout: comparison
title: Pantry Lane now delivers at half the cost
eyebrow: Before and after
reveal: true
budget: 1m
options:
  - name: Pantry Lane, 2024
    summary: Delivering in its own vans
  - name: Pantry Lane, 2026
    summary: Same hour with Wrenhaul
rows:
  - label: Same-day orders a shop
    values: [38 a week, 62 a week]
    winner: 2
  - label: Cost per delivery
    values: ["€6.80", "€3.20"]
    winner: 2
  - label: Complaints per 1,000
    values: ["14", "4"]
    winner: 2
  - label: Orders after noon
    values: [false, true]
    winner: 2
  - label: Orders over 25 kg
    values: [In its own van, Passed to a partner van]
    winner: 1
---

<Footnote>Pantry Lane Grocers, 34 shops in four cities: 2024 against October 2026.</Footnote>

<Notes>
`comparison` with two options as before and after, checks and dashes, and `reveal: true`; use it for a customer's own numbers, including the one that got worse.
[click] Pantry Lane in 2024, delivering from its own vans: 38 same-day orders a shop each week, and nothing taken after noon.
[click] And with us: 62 a week, at half the cost, with a third of the complaints. One thing got harder: crates over 25 kg now go to a partner van.
</Notes>

Slide 64 of the lookbook deckView on GitHub

Two options serve here as before and after. Each row names its winner, drawn bold with a diamond, and the last row is won by the old way: setting winner on the rows your side loses keeps the slide honest. false and true draw a dash and a check. The reference below shows three options with recommended: true.

When to use it

  • Two or three alternatives, two to five rows. options and rows are both required. Each row has a label and one value per option, in the order of options: text, or true and false.
  • The same measures apply to every option. If the options are ideas that are not alternatives, use cards; if each option is one number, use stats.
  • You recommend one. recommended: true on at most one option sets its column on a panel with an accent rule under a badge, “Recommended” unless you write badge: (up to 20 characters).
  • You present one option per click. reveal: true adds one option per step.

The title takes up to 50 characters, one line, so the rows fit under it. With three options the columns are narrower: a row label takes 18 characters instead of 24, a value 20 instead of 28, and an option’s summary 24 instead of 36. More than three options or five rows is a table. For plans with a price each, use pricing; for what to do and what to avoid, do-dont; and for pictures of one thing before and after a change, before-after.

Reference

Frontmatter
layout: comparison
Surface
the deck's default
Title
required, 50 characters at most
PowerPoint
title-only slide

Two or three options side by side, measured on the same two to five rows: us and them, or the options of a decision, from options: and rows: in the frontmatter. Each row has a label and one value per option (text, or true and false for a check and a dash) and may name its winner, the number of the option that wins that row, which is drawn bold with a diamond. Mark the option you recommend with recommended: true: its column is set on a panel with an accent rule under a badge (badge:, "Recommended" by default). reveal: true adds one option per click. Use stats when each option is one number, a table for more than three options or five rows, and cards for ideas that are not alternatives; use pricing for plans, do-dont for behaviours, before-after for pictures of a change, or shift for a change in words.

A slide in the comparison layout: A bike beats a van on every row but one.
A lookbook slide in this layout, not the example belowlookbook / comparison-modes

Slots

SlotTakesBudgetWhat goes in it
body—Content outside every slot tag (in TSX, the default export).
<Footnote>text24 wordsA source or caveat on the bottom line.

Frontmatter fields

FieldValuesHow to use it
eyebrowtextWrite a few words of at most 40 characters, for example eyebrow: Budget committee, or leave it out.
optionsrequiredtextList 2 or 3 options in the order of their columns, each with name (up to 24 characters) and optionally summary (up to 36, 24 with three options) and recommended: true on the one you recommend.
rowsrequiredtextList 2 to 5 rows, each with label (up to 24 characters, 18 with three options) and values, one per option (2 or 3) in the same order: text (up to 28, 20 with three options), or true and false for a check and a dash. Add winner: 2 to a row to mark the option that wins it (1 to the number of options, in the order of options), drawn bold with a diamond in that cell; set it on the rows the recommended option loses too, so the slide is honest about the trade.
badgedefault RecommendedWrite the word over the recommended option, up to 20 characters, such as badge: Our pick or badge: Empfohlen; it defaults to "Recommended".
revealtrue false (default)Write reveal: true to show the items one per step, in order, or leave it out to show them all at once.
chrometrue (default) falseWrite chrome: false to hide the page number, logo and progress bar on this slide, or chrome: true to show them.

Variants

  • three options — options[].summary: 24 characters; rows[].label: 18 characters; rows[].values[]: 20 characters

Example

---
layout: comparison
title: Large trees cost more and cool far more
eyebrow: The species choice
options:
  - name: Ornamental pear
    summary: Planted across the city since 2005
  - name: London plane
    summary: What the plan proposes
    recommended: true
rows:
  - label: Cost to plant
    values:
      - "$1,900"
      - "$4,600"
    winner: 1
  - label: Crown at 20 years
    values:
      - "30 m²"
      - "240 m²"
    winner: 2
  - label: Survives a dry summer
    values:
      - false
      - true
    winner: 2
---

<Footnote>Costs include the soil cells; crowns from the Larkfield tree survey.</Footnote>

<Notes>
The plane costs two and a half times as much and shades eight times the ground.
</Notes>

Common mistakes

Two-option text in a three-option slide. The narrower limits of the three-option variant are checked when the slide is built, so deck lint reports them before it renders any slide:

$ deck lint launch-review
decks/launch-review/slides/species.mdx
  error   schema (species): rows[0].label: The comparison layout sets at most 18 characters here (three options), got 21.
          Fix: Shorten it to the essentials; `deck layouts --json` lists the limits of each variant.
  error   schema (species): rows[0].values[0]: The comparison layout sets at most 20 characters here (three options), got 24.
          Fix: Shorten it to the essentials; `deck layouts --json` lists the limits of each variant.

launch-review: 2 errors, 0 warnings.

A row with a value missing. Every row needs one value per option; write false for a dash. A row with one value for two options stops the build with rows[0].values: Expected a value for each option, got a list of 1 item.

Two recommended options. The layout recommends at most one: options: 2 options are recommended (Pear, Plane); a comparison recommends at most one.

A winner that counts from zero. winner is the number of the option in the order of options, starting at 1.

A long footnote. The footnote takes up to 24 words; past that, content-budget reports The footnote slot holds 31 words; its layout allows 24.

  • table: more than three options or five rows, or exact values to look up.
  • shift: one change from the old state to the new, rather than options to choose from.
  • cards: two to four ideas of equal weight that are not alternatives.
  • stats: each option is one number.
  • pricing: two to four plans side by side, each with its price and what it includes.
  • do-dont: two columns of examples, what to do and what to avoid.
  • before-after: two pictures at the same size, labelled Before and After.

What reveal does is on builds.

Type to search…

↑↓ navigate↵ selectEsc close