Surfaces and display
Comparison table
A table that compares plans or options feature by feature. table.kui-table.kui-compare: the first column names the feature, each other column is an option, and one column can be marked as recommended.
Examples
Three plans
The recommended column has data-recommended on its head and its cells. A tick and a dash carry hidden words, so each cell reads as “Included” or “Not included”.
| Feature | Solo | Kancelarija Recommended | Firma |
|---|---|---|---|
| Price per month | 1 900 RSD | 5 400 RSD | 14 900 RSD |
| People | 1 | Up to 6 | Unlimited |
| Deadline reminders | Included | Included | Included |
| Shared calendar | Not included | Included | Included |
| eFaktura sending | Not included | 100 a month | Unlimited |
| Archive | 1 year | 10 years | 10 years |
HTML
<div class="kui-table-wrap" role="region" aria-labelledby="compare-cap" tabindex="0">
<table class="kui-table kui-compare">
<caption id="compare-cap">Plans for a law office</caption>
<thead><tr><th scope="col">Feature</th><th scope="col">Solo</th><th scope="col" data-recommended>Kancelarija <span class="kui-badge kui-badge--accent">Recommended</span></th><th scope="col">Firma</th></tr></thead>
<tbody>
<tr><th scope="row">Price per month</th><td>1 900 RSD</td><td data-recommended>5 400 RSD</td><td>14 900 RSD</td></tr>
<tr><th scope="row">People</th><td>1</td><td data-recommended>Up to 6</td><td>Unlimited</td></tr>
<tr><th scope="row">Deadline reminders</th><td><svg class="kui-icon kui-compare__mark" aria-hidden="true"><use href="kit/icons.svg#check"></use></svg><span class="kui-visually-hidden">Included</span></td><td data-recommended><svg class="kui-icon kui-compare__mark" aria-hidden="true"><use href="kit/icons.svg#check"></use></svg><span class="kui-visually-hidden">Included</span></td><td><svg class="kui-icon kui-compare__mark" aria-hidden="true"><use href="kit/icons.svg#check"></use></svg><span class="kui-visually-hidden">Included</span></td></tr>
<tr><th scope="row">Shared calendar</th><td><span class="kui-compare__none" aria-hidden="true">–</span><span class="kui-visually-hidden">Not included</span></td><td data-recommended><svg class="kui-icon kui-compare__mark" aria-hidden="true"><use href="kit/icons.svg#check"></use></svg><span class="kui-visually-hidden">Included</span></td><td><svg class="kui-icon kui-compare__mark" aria-hidden="true"><use href="kit/icons.svg#check"></use></svg><span class="kui-visually-hidden">Included</span></td></tr>
<tr><th scope="row">eFaktura sending</th><td><span class="kui-compare__none" aria-hidden="true">–</span><span class="kui-visually-hidden">Not included</span></td><td data-recommended>100 a month</td><td>Unlimited</td></tr>
<tr><th scope="row">Archive</th><td>1 year</td><td data-recommended>10 years</td><td>10 years</td></tr>
</tbody>
</table>
</div>
States
Every state
On a phone the table keeps its columns and the region scrolls sideways; the feature names stay readable on the left. A cell can hold words instead of a tick when the answer has a limit (“100 a month”). Without a recommended column all options look equal.
| Feature | Paušalno oporezivanje | Samooporezivanje |
|---|---|---|
| Bookkeeping | Not required | Double-entry |
| Monthly tax known in advance | Yes | No |
HTML
<div class="kui-table-wrap" role="region" aria-labelledby="compare-s-cap" tabindex="0">
<table class="kui-table kui-compare">
<caption id="compare-s-cap">Two options, none recommended</caption>
<thead><tr><th scope="col">Feature</th><th scope="col">Paušalno oporezivanje</th><th scope="col">Samooporezivanje</th></tr></thead>
<tbody>
<tr><th scope="row">Bookkeeping</th><td>Not required</td><td>Double-entry</td></tr>
<tr><th scope="row">Monthly tax known in advance</th><td><svg class="kui-icon kui-compare__mark" aria-hidden="true"><use href="kit/icons.svg#check"></use></svg><span class="kui-visually-hidden">Yes</span></td><td><span class="kui-compare__none" aria-hidden="true">–</span><span class="kui-visually-hidden">No</span></td></tr>
</tbody>
</table>
</div>
Classes and attributes
table.kui-table.kui-compare- The comparison table, in a .kui-table-wrap.
th[scope="row"]- The feature’s name, in the first column.
[data-recommended]- On the head and the cells of the recommended column.
.kui-compare__mark- On a tick icon: green.
.kui-compare__none- On a dash: faint.
Keyboard
- Tab
- Moves to the table’s region.
- Arrow Left or Arrow Right
- Scroll a focused region sideways on a narrow screen.
Accessibility
- Features are row heads and options are column heads, so a screen reader reads “Shared calendar, Solo, Not included” for each cell.
- Ticks and dashes are aria-hidden with the answer in hidden words.
- The recommended column also says so in words, in a badge in its head.
Do and do not
Do
- Put the price first.
- Keep to three or four options.
- Write limits as numbers, not as “Some”.
Do not
- Do not mark more than one column as recommended.
- Do not use only colour to show what is included.
- Do not list fifty features; group them or link to a full list.