It is rendered visually hidden and read by a screen reader before the table, which is how a non-sighted reader knows what is being compared. Without it the table announces as an unlabelled grid of ticks.
Recommended option
Mark the recommended option, and its column is tinted from header to last cell, so the eye lands on it.
<app-compare-table caption="IEC 62305, NFPA 780 and AS 1768 compared topic by topic">
<app-compare-column label="Topic" />
<app-compare-column label="IEC 62305" />
<app-compare-column label="NFPA 780" />
<app-compare-column label="AS 1768" />
<app-compare-row label="Tolerable risk R_T">
<app-compare-cell>10<sup>-5</sup> per year, <a href="#clause">clause 4.2</a></app-compare-cell>
<app-compare-cell>10⁻⁵ per year, 1,000 h</app-compare-cell>
<app-compare-cell>10⁻⁵ per year</app-compare-cell>
</app-compare-row>
<app-compare-row label="Lightning density N_g">
<app-compare-cell>Per km² per year</app-compare-cell>
<app-compare-cell>Per km² per year</app-compare-cell>
<app-compare-cell>Per km², per year</app-compare-cell>
</app-compare-row>
</app-compare-table>
Draw rates, charges and other figures as ruled rows with no frame, so the table sits in running text.
Ruled rows
Charges on a business loan
Rate
Fee
Term loan
14% a year
1% of the amount
Overdraft
16% a year
0.5% of the limit
Show code
<app-compare-table caption="Charges on a business loan" variant="Plain" mobile="Scroll">
<app-compare-column label="" />
<app-compare-column label="Rate" />
<app-compare-column label="Fee" />
<app-compare-row label="Term loan">
<app-compare-cell>14% a year</app-compare-cell>
<app-compare-cell>1% of the amount</app-compare-cell>
</app-compare-row>
<app-compare-row label="Overdraft">
<app-compare-cell>16% a year</app-compare-cell>
<app-compare-cell>0.5% of the limit</app-compare-cell>
</app-compare-row>
</app-compare-table>
pair it with mobile scroll
A figure table keeps its columns on a phone, so set mobile="scroll"; the default stack turns rows into ruled blocks.
Sideways scroll
A wide table scrolls sideways on a phone with its first column held in place, so the row labels stay visible.
group on each row: a heading row above each run of rows that share it
row groups
Free
Pro
Usage
Reports per month
3
Unlimited
Sites
1
25
Security
Single sign-on
No:
Yes:
key (React only): a stable id for the row
row key
Free
Pro
Single sign-on
No:
Yes:
rows: label and long content
long row label wraps within the row-header column
long row label
Free
Pro
Single sign-on with SAML2 and SCIM-based automatic user provisioning
No:
Yes:
long cell value wraps within its column
long cell value
Free
Pro
Support
Community forum only, best effort
Dedicated 24×7 phone and email support
mobile
mobile="stack" (default): under 576px each row is a card
stacked table
Plan
Single sign-on
Yes:
mobile="scroll": under 576px the table scrolls sideways
scrolling table
Plan
Single sign-on
Yes:
sticky first column
sticky-first-column="false" (default)
first column not held
Free
Pro
Single sign-on
No:
Yes:
sticky-first-column="true": with mobile scroll, the first column stays in place
first column held
Free
Pro
Single sign-on
No:
Yes:
sticky header
sticky-header="false" (default)
header not held
Free
Pro
Single sign-on
No:
Yes:
sticky-header="true": the header row stays on screen while a long table scrolls past
sticky header
Free
Pro
Single sign-on
No:
Yes:
density
density="comfortable" (default)
comfortable density
Plan
Single sign-on
Yes:
density="relaxed": 16px body and 32px side padding
relaxed density
Plan
Single sign-on
Yes:
variant
variant="boxed" (default)
boxed variant
Plan
Single sign-on
Yes:
variant="plain": ruled rows with no frame
plain variant
Plan
Single sign-on
Yes:
yes, no, warning and partial labels
yes-label="Included" (default is "Yes")
yes label
Plan
Feature
Included:
no-label="Not included" (default is "No")
no label
Plan
Feature
Not included:
warning-label="Limited" (default is "Warning")
warning label
Plan
Feature
Limited:
partial-label="Some" (default is "Partial")
partial label
Plan
Feature
Some:
className
class="pricing-table": appended to the base compare-table class
className
Plan
Feature
Yes:
Guidance
What to do, and what to avoid.
Use it when
A reader is choosing between two to four options on the same criteria.
A page shows figures in ruled rows with no frame, such as rates and charges (variant plain).
The rows are authored capabilities, not records from a query.
Seeing the options side by side is what makes the choice obvious.
Reach for something else when
The rows are records to sort, filter or page through. → AppDataTable
You are showing the tiers themselves with prices and CTAs. → AppPricingCard
It is a list of facts about one thing. → AppDescriptions
Booleans as ticks, plain row labels
Do
Good example
Free
Pro
Single sign-on
No:
Yes:
Every row appears for every column, so the reader can read across. The row label names the capability in the customer’s words.
Avoid
Bad example
Free
Pro
SSO / SAML2 IdP federation
-
Y
Two highlighted columns both tint, so no option reads as the recommendation; internal jargon in the row label; and hand-typed dashes and Y instead of booleans lose the tick's shape cue.
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
18 props. The 3 most used come first.
Used on most screens 3 props
Prop
Type
Default
Description
captiondefault -
string
-
Visually hidden description of what is being compared.
mobiledefault stack
stack | scroll
stack
Under 576px: stack rows as cards, or scroll sideways.
sticky-first-columndefault false
bool
false
Keeps the first column in view with mobile="scroll".
Less common 15 props
Prop
Type
Default
Description
sticky-headerdefault false
bool
false
Keeps the heading row in view while the table scrolls.
densitydefault comfortable
comfortable | relaxed
comfortable
Row spacing and text size.
variantdefault boxed
boxed | plain
boxed
plain draws a figure table: ruled rows with no frame or shaded first column, and body-size text.
yes-labeldefault Yes
string
Yes
The screen-reader word for a yes cell.
no-labeldefault No
string
No
The screen-reader word for a no cell.
warning-labeldefault Warning
string
Warning
The screen-reader word for a warn cell.
partial-labeldefault Partial
string
Partial
The screen-reader word for a partial cell.
app-compare-column labeldefault -
string
-
The column heading. The first column is the capability-name column.
app-compare-column highlightdefault false
bool
false
Tints the recommended column.
app-compare-column aligndefault start
start | center
start
Alignment of the column's cells.
app-compare-column no-wrapdefault false
bool
false
Keeps the column's cells on one line.
app-compare-row labeldefault -
string
-
The capability named in the row header.
app-compare-row groupdefault -
string
-
The heading of the group this row sits in.
app-compare-cell statedefault -
yes | no | warn | partial
-
Draws the state's icon and speaks its word before the body.
app-compare-cell codedefault false
bool
false
Sets the body as a reference code.
Screen reader
6 notes
The caption prop is a visually hidden table caption, read by a screen reader before the table.
Column headings are th elements with scope col.
Each row label is a th element with scope row.
Each cell repeats its column name in data-label, so a stacked phone card reads the same as the table.
A state's icon is hidden from screen readers; its state is spoken as a hidden prefix such as Yes or Warning.
With mobile scroll, the scrolling region is focusable and named by the caption.
Do and avoid
1 pairs
Booleans as ticks, plain row labels
Do
Good example
Free
Pro
Single sign-on
No:
Yes:
Every row appears for every column, so the reader can read across. The row label names the capability in the customer’s words.
Avoid
Bad example
Free
Pro
SSO / SAML2 IdP federation
-
Y
Two highlighted columns both tint, so no option reads as the recommendation; internal jargon in the row label; and hand-typed dashes and Y instead of booleans lose the tick's shape cue.