Tearsheet

Issue 01 · Sections · p.72

Plan comparison

Plans side by side with yes/no marks that read as words to screen readers, and the recommended plan marked.

Why it works: Each tick and cross has hidden text (“Included”, “Not included”), so the table makes sense without seeing the icons. The recommended column is labelled in words, not just colour.

Try it:
Receipt: axe clean · contrast 5.35:1 · 0 tab stops · RTL ✓ · long text ✓

Tab order: nothing here takes focus (it is content, not controls).

What assistive tech is given

- table "Compare plans":
  - caption: Compare plans
  - rowgroup:
    - row "Feature Free Group Recommended Team":
      - columnheader "Feature"
      - columnheader "Free"
      - columnheader "Group Recommended"
      - columnheader "Team"
  - rowgroup:
    - row "People per group 5 25 Unlimited":
      - rowheader "People per group"
      - cell "5"
      - cell "25"
      - cell "Unlimited"
    - row "Receipt photos Included Included Included":
      - rowheader "Receipt photos"
      - cell "Included"
      - cell "Included"
      - cell "Included"
    - row "Multi-currency Not included Included Included":
      - rowheader "Multi-currency"
      - cell "Not included"
      - cell "Included"
      - cell "Included"
    - row "Export to CSV Included Included Included":
      - rowheader "Export to CSV"
      - cell "Included"
      - cell "Included"
      - cell "Included"
    - row "Admin controls Not included Not included Included":
      - rowheader "Admin controls"
      - cell "Not included"
      - cell "Not included"
      - cell "Included"
    - row "Price $0 $3 / month $12 / month":
      - rowheader "Price"
      - cell "$0"
      - cell "$3 / month"
      - cell "$12 / month"

Automated checks in CI (axe in Chromium, reduced motion on). They catch a lot, not everything: still try it with a screen reader.

See it in the zine npx -y tearsheet add comparison-table

Needs the shared tokens.css once per project.

HTML + CSS

index.html
<!-- tearsheet comparison-table va6a207c7 · https://qusaialjbali.github.io/tearsheet/zine/parts/comparison-table.html -->
<div class="cmp-wrap">
  <table class="cmp">
    <caption>Compare plans</caption>
    <thead>
      <tr><th scope="col"><span class="sr-only">Feature</span></th><th scope="col">Free</th><th scope="col" class="cmp-rec">Group <span>Recommended</span></th><th scope="col">Team</th></tr>
    </thead>
    <tbody>
      <tr><th scope="row">People per group</th><td>5</td><td class="cmp-rec">25</td><td>Unlimited</td></tr>
      <tr><th scope="row">Receipt photos</th><td><span class="y"><span class="sr-only">Included</span></span></td><td class="cmp-rec"><span class="y"><span class="sr-only">Included</span></span></td><td><span class="y"><span class="sr-only">Included</span></span></td></tr>
      <tr><th scope="row">Multi-currency</th><td><span class="n"><span class="sr-only">Not included</span></span></td><td class="cmp-rec"><span class="y"><span class="sr-only">Included</span></span></td><td><span class="y"><span class="sr-only">Included</span></span></td></tr>
      <tr><th scope="row">Export to CSV</th><td><span class="y"><span class="sr-only">Included</span></span></td><td class="cmp-rec"><span class="y"><span class="sr-only">Included</span></span></td><td><span class="y"><span class="sr-only">Included</span></span></td></tr>
      <tr><th scope="row">Admin controls</th><td><span class="n"><span class="sr-only">Not included</span></span></td><td class="cmp-rec"><span class="n"><span class="sr-only">Not included</span></span></td><td><span class="y"><span class="sr-only">Included</span></span></td></tr>
      <tr><th scope="row">Price</th><td>$0</td><td class="cmp-rec">$3 / month</td><td>$12 / month</td></tr>
    </tbody>
  </table>
</div>
styles.css
/* tearsheet comparison-table va6a207c7 · https://qusaialjbali.github.io/tearsheet/zine/parts/comparison-table.html */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cmp-wrap { width: 100%; overflow-x: auto; background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-radius); }
.cmp { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 15px; }
.cmp caption { padding: 18px 20px 6px; text-align: start; font-size: 18px; font-weight: 700; }
.cmp th, .cmp td { padding: 13px 20px; text-align: center; border-bottom: 1px solid var(--ui-border); }
.cmp tbody th { text-align: start; font-weight: 500; color: var(--ui-muted); }
.cmp thead th { font-size: 16px; }
.cmp tbody tr:last-child > * { border-bottom: 0; font-weight: 700; color: var(--ui-text); }
.cmp-rec { background: var(--ui-accent-soft); }
thead .cmp-rec span { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ui-accent); }
.y, .n { display: inline-block; width: 20px; height: 20px; vertical-align: middle; background: var(--ui-success); }
.n { background: var(--ui-border-strong); }
.y { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10.5 4 4 8-9' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10.5 4 4 8-9' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.n { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }

React

ComparisonTable.jsx
/* tearsheet comparison-table va6a207c7 · https://qusaialjbali.github.io/tearsheet/zine/parts/comparison-table.html */
import './ComparisonTable.css';

export function ComparisonTable() {
  return (
    <div className="cmp-wrap">
      <table className="cmp">
        <caption>Compare plans</caption>
        <thead>
          <tr><th scope="col"><span className="sr-only">Feature</span></th><th scope="col">Free</th><th scope="col" className="cmp-rec">Group <span>Recommended</span></th><th scope="col">Team</th></tr>
        </thead>
        <tbody>
          <tr><th scope="row">People per group</th><td>5</td><td className="cmp-rec">25</td><td>Unlimited</td></tr>
          <tr><th scope="row">Receipt photos</th><td><span className="y"><span className="sr-only">Included</span></span></td><td className="cmp-rec"><span className="y"><span className="sr-only">Included</span></span></td><td><span className="y"><span className="sr-only">Included</span></span></td></tr>
          <tr><th scope="row">Multi-currency</th><td><span className="n"><span className="sr-only">Not included</span></span></td><td className="cmp-rec"><span className="y"><span className="sr-only">Included</span></span></td><td><span className="y"><span className="sr-only">Included</span></span></td></tr>
          <tr><th scope="row">Export to CSV</th><td><span className="y"><span className="sr-only">Included</span></span></td><td className="cmp-rec"><span className="y"><span className="sr-only">Included</span></span></td><td><span className="y"><span className="sr-only">Included</span></span></td></tr>
          <tr><th scope="row">Admin controls</th><td><span className="n"><span className="sr-only">Not included</span></span></td><td className="cmp-rec"><span className="n"><span className="sr-only">Not included</span></span></td><td><span className="y"><span className="sr-only">Included</span></span></td></tr>
          <tr><th scope="row">Price</th><td>$0</td><td className="cmp-rec">$3 / month</td><td>$12 / month</td></tr>
        </tbody>
      </table>
    </div>
  );
}
ComparisonTable.css
/* tearsheet comparison-table va6a207c7 · https://qusaialjbali.github.io/tearsheet/zine/parts/comparison-table.html */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cmp-wrap { width: 100%; overflow-x: auto; background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-radius); }
.cmp { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 15px; }
.cmp caption { padding: 18px 20px 6px; text-align: start; font-size: 18px; font-weight: 700; }
.cmp th, .cmp td { padding: 13px 20px; text-align: center; border-bottom: 1px solid var(--ui-border); }
.cmp tbody th { text-align: start; font-weight: 500; color: var(--ui-muted); }
.cmp thead th { font-size: 16px; }
.cmp tbody tr:last-child > * { border-bottom: 0; font-weight: 700; color: var(--ui-text); }
.cmp-rec { background: var(--ui-accent-soft); }
thead .cmp-rec span { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ui-accent); }
.y, .n { display: inline-block; width: 20px; height: 20px; vertical-align: middle; background: var(--ui-success); }
.n { background: var(--ui-border-strong); }
.y { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10.5 4 4 8-9' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10.5 4 4 8-9' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.n { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }

Vue

ComparisonTable.vue
<!-- tearsheet comparison-table va6a207c7 · https://qusaialjbali.github.io/tearsheet/zine/parts/comparison-table.html -->
<template>
  <div class="cmp-wrap">
    <table class="cmp">
      <caption>Compare plans</caption>
      <thead>
        <tr><th scope="col"><span class="sr-only">Feature</span></th><th scope="col">Free</th><th scope="col" class="cmp-rec">Group <span>Recommended</span></th><th scope="col">Team</th></tr>
      </thead>
      <tbody>
        <tr><th scope="row">People per group</th><td>5</td><td class="cmp-rec">25</td><td>Unlimited</td></tr>
        <tr><th scope="row">Receipt photos</th><td><span class="y"><span class="sr-only">Included</span></span></td><td class="cmp-rec"><span class="y"><span class="sr-only">Included</span></span></td><td><span class="y"><span class="sr-only">Included</span></span></td></tr>
        <tr><th scope="row">Multi-currency</th><td><span class="n"><span class="sr-only">Not included</span></span></td><td class="cmp-rec"><span class="y"><span class="sr-only">Included</span></span></td><td><span class="y"><span class="sr-only">Included</span></span></td></tr>
        <tr><th scope="row">Export to CSV</th><td><span class="y"><span class="sr-only">Included</span></span></td><td class="cmp-rec"><span class="y"><span class="sr-only">Included</span></span></td><td><span class="y"><span class="sr-only">Included</span></span></td></tr>
        <tr><th scope="row">Admin controls</th><td><span class="n"><span class="sr-only">Not included</span></span></td><td class="cmp-rec"><span class="n"><span class="sr-only">Not included</span></span></td><td><span class="y"><span class="sr-only">Included</span></span></td></tr>
        <tr><th scope="row">Price</th><td>$0</td><td class="cmp-rec">$3 / month</td><td>$12 / month</td></tr>
      </tbody>
    </table>
  </div>
</template>

<style scoped>
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cmp-wrap { width: 100%; overflow-x: auto; background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-radius); }
.cmp { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 15px; }
.cmp caption { padding: 18px 20px 6px; text-align: start; font-size: 18px; font-weight: 700; }
.cmp th, .cmp td { padding: 13px 20px; text-align: center; border-bottom: 1px solid var(--ui-border); }
.cmp tbody th { text-align: start; font-weight: 500; color: var(--ui-muted); }
.cmp thead th { font-size: 16px; }
.cmp tbody tr:last-child > * { border-bottom: 0; font-weight: 700; color: var(--ui-text); }
.cmp-rec { background: var(--ui-accent-soft); }
thead .cmp-rec span { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ui-accent); }
.y, .n { display: inline-block; width: 20px; height: 20px; vertical-align: middle; background: var(--ui-success); }
.n { background: var(--ui-border-strong); }
.y { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10.5 4 4 8-9' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10.5 4 4 8-9' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.n { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
</style>

Svelte

ComparisonTable.svelte
<!-- tearsheet comparison-table va6a207c7 · https://qusaialjbali.github.io/tearsheet/zine/parts/comparison-table.html -->
<div class="cmp-wrap">
  <table class="cmp">
    <caption>Compare plans</caption>
    <thead>
      <tr><th scope="col"><span class="sr-only">Feature</span></th><th scope="col">Free</th><th scope="col" class="cmp-rec">Group <span>Recommended</span></th><th scope="col">Team</th></tr>
    </thead>
    <tbody>
      <tr><th scope="row">People per group</th><td>5</td><td class="cmp-rec">25</td><td>Unlimited</td></tr>
      <tr><th scope="row">Receipt photos</th><td><span class="y"><span class="sr-only">Included</span></span></td><td class="cmp-rec"><span class="y"><span class="sr-only">Included</span></span></td><td><span class="y"><span class="sr-only">Included</span></span></td></tr>
      <tr><th scope="row">Multi-currency</th><td><span class="n"><span class="sr-only">Not included</span></span></td><td class="cmp-rec"><span class="y"><span class="sr-only">Included</span></span></td><td><span class="y"><span class="sr-only">Included</span></span></td></tr>
      <tr><th scope="row">Export to CSV</th><td><span class="y"><span class="sr-only">Included</span></span></td><td class="cmp-rec"><span class="y"><span class="sr-only">Included</span></span></td><td><span class="y"><span class="sr-only">Included</span></span></td></tr>
      <tr><th scope="row">Admin controls</th><td><span class="n"><span class="sr-only">Not included</span></span></td><td class="cmp-rec"><span class="n"><span class="sr-only">Not included</span></span></td><td><span class="y"><span class="sr-only">Included</span></span></td></tr>
      <tr><th scope="row">Price</th><td>$0</td><td class="cmp-rec">$3 / month</td><td>$12 / month</td></tr>
    </tbody>
  </table>
</div>

<style>
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cmp-wrap { width: 100%; overflow-x: auto; background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-radius); }
.cmp { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 15px; }
.cmp caption { padding: 18px 20px 6px; text-align: start; font-size: 18px; font-weight: 700; }
.cmp th, .cmp td { padding: 13px 20px; text-align: center; border-bottom: 1px solid var(--ui-border); }
.cmp tbody th { text-align: start; font-weight: 500; color: var(--ui-muted); }
.cmp thead th { font-size: 16px; }
.cmp tbody tr:last-child > * { border-bottom: 0; font-weight: 700; color: var(--ui-text); }
.cmp-rec { background: var(--ui-accent-soft); }
thead .cmp-rec span { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ui-accent); }
.y, .n { display: inline-block; width: 20px; height: 20px; vertical-align: middle; background: var(--ui-success); }
.n { background: var(--ui-border-strong); }
.y { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10.5 4 4 8-9' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10.5 4 4 8-9' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.n { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
</style>