Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Comparing plans

Put one capability on each row and one option in each column, so a person compares plans at a glance.

A plan matrix
Plan comparison
FreePro
Reports per month3Unlimited
Sites125
Report revisionsNo: Yes:
Single sign-onNo: No:
Priority supportNo: Yes:
Show code
<app-compare-table caption="Plan comparison">
    <app-compare-column label="" />
    <app-compare-column label="Free" />
    <app-compare-column label="Pro" />
    <app-compare-row label="Reports per month">
        <app-compare-cell>3</app-compare-cell>
        <app-compare-cell>Unlimited</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="Sites">
        <app-compare-cell>1</app-compare-cell>
        <app-compare-cell>25</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="Report revisions">
        <app-compare-cell state="AppCompareCellState.No" />
        <app-compare-cell state="AppCompareCellState.Yes" />
    </app-compare-row>
    <app-compare-row label="Single sign-on">
        <app-compare-cell state="AppCompareCellState.No" />
        <app-compare-cell state="AppCompareCellState.No" />
    </app-compare-row>
    <app-compare-row label="Priority support">
        <app-compare-cell state="AppCompareCellState.No" />
        <app-compare-cell state="AppCompareCellState.Yes" />
    </app-compare-row>
</app-compare-table>

Recommended option

Mark the recommended option, and its column is tinted from header to last cell, so the eye lands on it.

Recommending a tier
Plan comparison
FreeProEnterprise
Reports per month3UnlimitedUnlimited
Sites125Unlimited
Report revisionsNo: Yes: Yes:
Single sign-onNo: No: Yes:
Priority supportNo: Yes: Yes:
Show code
<app-compare-table caption="Plan comparison">
    <app-compare-column label="" />
    <app-compare-column label="Free" />
    <app-compare-column label="Pro" highlight="true" />
    <app-compare-column label="Enterprise" />
    <app-compare-row label="Reports per month">
        <app-compare-cell>3</app-compare-cell>
        <app-compare-cell>Unlimited</app-compare-cell>
        <app-compare-cell>Unlimited</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="Sites">
        <app-compare-cell>1</app-compare-cell>
        <app-compare-cell>25</app-compare-cell>
        <app-compare-cell>Unlimited</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="Report revisions">
        <app-compare-cell state="AppCompareCellState.No" />
        <app-compare-cell state="AppCompareCellState.Yes" />
        <app-compare-cell state="AppCompareCellState.Yes" />
    </app-compare-row>
    <app-compare-row label="Single sign-on">
        <app-compare-cell state="AppCompareCellState.No" />
        <app-compare-cell state="AppCompareCellState.No" />
        <app-compare-cell state="AppCompareCellState.Yes" />
    </app-compare-row>
    <app-compare-row label="Priority support">
        <app-compare-cell state="AppCompareCellState.No" />
        <app-compare-cell state="AppCompareCellState.Yes" />
        <app-compare-cell state="AppCompareCellState.Yes" />
    </app-compare-row>
</app-compare-table>

Row groups

Group consecutive rows under one heading that spans the table, so a long comparison reads in sections.

Two groups
Plan comparison by section
FreePro
Usage
Reports per month3Unlimited
Sites125
Security
Single sign-onNo: Yes:
Show code
<app-compare-table caption="Plan comparison by section">
    <app-compare-column label="" />
    <app-compare-column label="Free" />
    <app-compare-column label="Pro" />
    <app-compare-row label="Reports per month" group="Usage">
        <app-compare-cell>3</app-compare-cell>
        <app-compare-cell>Unlimited</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="Sites" group="Usage">
        <app-compare-cell>1</app-compare-cell>
        <app-compare-cell>25</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="Single sign-on" group="Security">
        <app-compare-cell state="AppCompareCellState.No" />
        <app-compare-cell state="AppCompareCellState.Yes" />
    </app-compare-row>
</app-compare-table>

Mixed values

Put numbers, words and ticks in the same column, so a limit and a yes or no sit side by side.

Numbers, text and booleans
Mixed value types
FreeProEnterprise
Reports per month3UnlimitedUnlimited
Storage1 GB50 GBCustom
Single sign-onNo: No: Yes:
Show code
<app-compare-table caption="Mixed value types">
    <app-compare-column label="" />
    <app-compare-column label="Free" />
    <app-compare-column label="Pro" highlight="true" />
    <app-compare-column label="Enterprise" />
    <app-compare-row label="Reports per month">
        <app-compare-cell>3</app-compare-cell>
        <app-compare-cell>Unlimited</app-compare-cell>
        <app-compare-cell>Unlimited</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="Storage">
        <app-compare-cell>1 GB</app-compare-cell>
        <app-compare-cell>50 GB</app-compare-cell>
        <app-compare-cell>Custom</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="Single sign-on">
        <app-compare-cell state="AppCompareCellState.No" />
        <app-compare-cell state="AppCompareCellState.No" />
        <app-compare-cell state="AppCompareCellState.Yes" />
    </app-compare-row>
</app-compare-table>

Reference tables

Use reference tables for standards, clause lookups and state cells, each cell with the detail it needs.

Standards matrix
IEC 62305, NFPA 780 and AS 1768 compared topic by topic
TopicIEC 62305NFPA 780AS 1768
Tolerable risk R_T10-5 per year, clause 4.210⁻⁵ per year, 1,000 h10⁻⁵ per year
Lightning density N_gPer km² per yearPer km² per yearPer km², per year
Show code
<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>
Lookup with clause codes
NFPA 780 solar arrays, requirement by requirement
RequirementAnswerClause
Array frame bondingRequired, 4 AWG minimum250.4
DC conductor sizing125% of short-circuit current690.8
Show code
<app-compare-table caption="NFPA 780 solar arrays, requirement by requirement">
    <app-compare-column label="Requirement" />
    <app-compare-column label="Answer" />
    <app-compare-column label="Clause" />
    <app-compare-row label="Array frame bonding">
        <app-compare-cell>Required, 4 AWG minimum</app-compare-cell>
        <app-compare-cell code>250.4</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="DC conductor sizing">
        <app-compare-cell>125% of short-circuit current</app-compare-cell>
        <app-compare-cell code>690.8</app-compare-cell>
    </app-compare-row>
</app-compare-table>
Versus a spreadsheet
This product against a spreadsheet, feature by feature
This productSpreadsheet
Clause mappingYes: Built inPartial: Manual
Audit trailYes: Every changeNo: None
Standards updatesWarning: Check each yearNo:
Show code
<app-compare-table caption="This product against a spreadsheet, feature by feature">
    <app-compare-column label="" />
    <app-compare-column label="This product" highlight="true" />
    <app-compare-column label="Spreadsheet" />
    <app-compare-row label="Clause mapping">
        <app-compare-cell state="AppCompareCellState.Yes">Built in</app-compare-cell>
        <app-compare-cell state="AppCompareCellState.Partial">Manual</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="Audit trail">
        <app-compare-cell state="AppCompareCellState.Yes">Every change</app-compare-cell>
        <app-compare-cell state="AppCompareCellState.No">None</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="Standards updates">
        <app-compare-cell state="AppCompareCellState.Warn">Check each year</app-compare-cell>
        <app-compare-cell state="AppCompareCellState.No" />
    </app-compare-row>
</app-compare-table>

Figure tables

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
RateFee
Term loan14% a year1% of the amount
Overdraft16% a year0.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>

Sideways scroll

A wide table scrolls sideways on a phone with its first column held in place, so the row labels stay visible.

Sideways scroll, sticky column
Three limits across five plan tiers.
Three limits across five plan tiers
LimitFreeStarterProTeamBusiness
Reports per month320UnlimitedUnlimitedUnlimited
Sites121025Unlimited
Report revisionsNo: No: Yes: Yes: Yes:
Show code
<app-compare-table caption="Three limits across five plan tiers" mobile="Scroll" sticky-first-column="true">
    <app-compare-column label="Limit" />
    <app-compare-column label="Free" />
    <app-compare-column label="Starter" />
    <app-compare-column label="Pro" />
    <app-compare-column label="Team" />
    <app-compare-column label="Business" />
    <app-compare-row label="Reports per month">
        <app-compare-cell>3</app-compare-cell>
        <app-compare-cell>20</app-compare-cell>
        <app-compare-cell>Unlimited</app-compare-cell>
        <app-compare-cell>Unlimited</app-compare-cell>
        <app-compare-cell>Unlimited</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="Sites">
        <app-compare-cell>1</app-compare-cell>
        <app-compare-cell>2</app-compare-cell>
        <app-compare-cell>10</app-compare-cell>
        <app-compare-cell>25</app-compare-cell>
        <app-compare-cell>Unlimited</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="Report revisions">
        <app-compare-cell state="AppCompareCellState.No" />
        <app-compare-cell state="AppCompareCellState.No" />
        <app-compare-cell state="AppCompareCellState.Yes" />
        <app-compare-cell state="AppCompareCellState.Yes" />
        <app-compare-cell state="AppCompareCellState.Yes" />
    </app-compare-row>
</app-compare-table>

Every option

Every value of every prop, one cell each.

columns: label

label="" (the capability-name column)
blank column label
Plan
FeatureYes:

columns: highlight

(default) no column highlighted
no highlight
FreePro
Single sign-onNo: Yes:
highlight="true" on one column: one tinted column
single highlight
FreePro
Single sign-onNo: Yes:
two columns highlighted: both tint
double highlight
FreePro
Single sign-onNo: Yes:

columns: align and nowrap

align="start" (default)
start alignment
Plan
Single sign-onYes:
align="center": cells centred under the heading
centred column
Plan
Single sign-onYes:
no-wrap="true": the column's cells stay on one line
no wrap
Plan
SupportDedicated 24×7 phone and email support

caption

caption set: visually hidden, read by screen readers
Plan comparison
Plan
FeatureYes:
caption omitted: no caption element
Plan
FeatureYes:

rows: cell values

state="yes" → tick (React: true)
yes state
Plan
FeatureYes:
state="no" → dash (React: false)
no state
Plan
FeatureNo:
plain text renders as written
text value
Plan
Storage50 GB
empty cell: '' → empty cell (React: '')
empty cell
Plan
Feature
HTML in the cell: a link and a comma, rendered as written (React: a node)
link cell
Plan
SupportGuide, updated monthly

rows: state, code and text cells

state="yes" with text
yes with text
Plan
FeatureYes: Built in
state="no" with text
no with text
Plan
FeatureNo: None
state="warn" with text
warn state
Plan
FeatureWarning: Beta
state="partial" with text
partial state
Plan
FeaturePartial: Some
code: a reference code (React: { code })
code cell
Plan
Clause5.1

rows: group

group on each row: a heading row above each run of rows that share it
row groups
FreePro
Usage
Reports per month3Unlimited
Sites125
Security
Single sign-onNo: Yes:
key (React only): a stable id for the row
row key
FreePro
Single sign-onNo: Yes:

rows: label and long content

long row label wraps within the row-header column
long row label
FreePro
Single sign-on with SAML2 and SCIM-based automatic user provisioningNo: Yes:
long cell value wraps within its column
long cell value
FreePro
SupportCommunity forum only, best effortDedicated 24×7 phone and email support

mobile

mobile="stack" (default): under 576px each row is a card
stacked table
Plan
Single sign-onYes:
mobile="scroll": under 576px the table scrolls sideways
scrolling table
Plan
Single sign-onYes:

sticky first column

sticky-first-column="false" (default)
first column not held
FreePro
Single sign-onNo: Yes:
sticky-first-column="true": with mobile scroll, the first column stays in place
first column held
FreePro
Single sign-onNo: Yes:

sticky header

sticky-header="false" (default)
header not held
FreePro
Single sign-onNo: Yes:
sticky-header="true": the header row stays on screen while a long table scrolls past
sticky header
FreePro
Single sign-onNo: Yes:

density

density="comfortable" (default)
comfortable density
Plan
Single sign-onYes:
density="relaxed": 16px body and 32px side padding
relaxed density
Plan
Single sign-onYes:

variant

variant="boxed" (default)
boxed variant
Plan
Single sign-onYes:
variant="plain": ruled rows with no frame
plain variant
Plan
Single sign-onYes:

yes, no, warning and partial labels

yes-label="Included" (default is "Yes")
yes label
Plan
FeatureIncluded:
no-label="Not included" (default is "No")
no label
Plan
FeatureNot included:
warning-label="Limited" (default is "Warning")
warning label
Plan
FeatureLimited:
partial-label="Some" (default is "Partial")
partial label
Plan
FeatureSome:

className

class="pricing-table": appended to the base compare-table class
className
Plan
FeatureYes:

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
FreePro
Single sign-onNo: 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
FreePro
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.

2 3 4
none 1 2 3
on off
mixed boolean
(default) stack scroll
(default) comfortable relaxed
(default) boxed plain
Plan comparison
FreeProEnterpriseUltimate
Usage
Reports per month3UnlimitedUnlimitedUnlimited
Storage1 GB50 GBCustomCustom
Security
Single sign-onNo: No: Yes: Yes:
React, generated from the controls
<AppCompareTable
  caption="Plan comparison"
  columns={[{ label: '' }, { label: 'Free' }, { label: 'Pro', highlight: true }, { label: 'Enterprise' }, { label: 'Ultimate' }]}
  rows={[
    { label: 'Reports per month', group: 'Usage', values: ['3', 'Unlimited', 'Unlimited', 'Unlimited'] },
    { label: 'Storage', group: 'Usage', values: ['1 GB', '50 GB', 'Custom', 'Custom'] },
    { label: 'Single sign-on', group: 'Security', values: [false, false, true, true] },
  ]}
/>
Razor, the same props
<app-compare-table caption="Plan comparison">
    <app-compare-column label="" />
    <app-compare-column label="Free" />
    <app-compare-column label="Pro" highlight="true" />
    <app-compare-column label="Enterprise" />
    <app-compare-column label="Ultimate" />
    <app-compare-row label="Reports per month" group="Usage">
        <app-compare-cell>3</app-compare-cell>
        <app-compare-cell>Unlimited</app-compare-cell>
        <app-compare-cell>Unlimited</app-compare-cell>
        <app-compare-cell>Unlimited</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="Storage" group="Usage">
        <app-compare-cell>1 GB</app-compare-cell>
        <app-compare-cell>50 GB</app-compare-cell>
        <app-compare-cell>Custom</app-compare-cell>
        <app-compare-cell>Custom</app-compare-cell>
    </app-compare-row>
    <app-compare-row label="Single sign-on" group="Security">
        <app-compare-cell state="AppCompareCellState.No"></app-compare-cell>
        <app-compare-cell state="AppCompareCellState.No"></app-compare-cell>
        <app-compare-cell state="AppCompareCellState.Yes"></app-compare-cell>
        <app-compare-cell state="AppCompareCellState.Yes"></app-compare-cell>
    </app-compare-row>
</app-compare-table>

18 props. The 3 most used come first.

Used on most screens 3 props

PropTypeDefaultDescription
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

PropTypeDefaultDescription
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
FreePro
Single sign-onNo: 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
FreePro
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.