Example#
| Templated | Semi-customMost picked | |
|---|---|---|
| Build | ||
| Pages | Up to 5 | Up to 12 |
| Your own layout | Not included | Included |
Usage#
Use a comparison table for pricing tiers or plans, two to five of them, compared feature by feature. On desktops it is a real table with sticky tier heads; below the md width it switches to one tier at a time with a segmented control, without JavaScript.
- Tiers take a name, a note (such as the timeline), an optional CTA and
recommended, which draws a 3 px ink box around the column and a badge withrecommendedLabel. - Values.
trueprints a check with "Included" for screen readers,falsea dash with "Not included", and strings print as text: prices stay literal. - Groups split the rows under group headings, such as Build and Care.
Anatomy#
| Templated | Semi-customMost picked | |
|---|---|---|
| Build | ||
| Pages | Up to 5 | Up to 12 |
| Your own layout | Not included | Included |
- Tier headName and note; sticky under the header.
.mk-comparison-table-tier - RecommendedA badge, plus a 3 px ink box around the column.
.mk-comparison-table-badge - GroupA row group heading.
.mk-comparison-table-group - FeatureThe row's name, with an optional description.
.mk-comparison-table-feature
Volume#
Reading layer: identical at every volume.
Quiet
What each tier includes Templated Semi-customMost picked Build Pages Up to 5 Up to 12 Your own layout Not included Included Studio
What each tier includes Templated Semi-customMost picked Build Pages Up to 5 Up to 12 Your own layout Not included Included Press
What each tier includes Templated Semi-customMost picked Build Pages Up to 5 Up to 12 Your own layout Not included Included Rave
What each tier includes Templated Semi-customMost picked Build Pages Up to 5 Up to 12 Your own layout Not included Included
Content#
- Tier names are short and ordered by size: "Templated", "Semi-custom", "Custom".
- Features are nouns people look for: "Pages", "Your own layout".
- Strings beat ticks when the answer is a quantity: "Up to 12", not a check mark.
- The recommended label is honest: "Most picked" if it is, never "Best value" unless you can show it.
Do and don't#
Do
| Templated | Semi-customMost picked | |
|---|---|---|
| Build | ||
| Pages | Up to 5 | Up to 12 |
| Your own layout | Not included | Included |
Don't
Five tiers, thirty rows of ticks and no prices.
Accessibility#
- A real table: tier heads are column headers, groups are row groups, features are row headers.
- Checks and dashes carry the words "Included" and "Not included" for screen readers.
- On phones the switcher's native radios pick the tier; hidden columns leave the accessibility tree.
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
caption required | string | none | |
tiers required | readonly ComparisonTier[] | none | 2 to 5 tiers. |
groups required | readonly ComparisonGroup[] | none | |
recommendedLabel | string | none | The recommended tier's badge (no default copy). |
switcherLabel | string | "Show tier" | The switcher's name (default "Show tier"). |
switcherName | string | from the caption and a per-instance id, so two tables with one caption on
a page keep their own checked tier | The switcher's radio name (default from the caption and a per-instance id, so two tables with one caption on a page keep their own checked tier). |
includedLabel | string | none | Words for `true` and `false` (defaults "Included", "Not included"). |
notIncludedLabel | string | none |
Tokens#
System tokens (11)
--mk-border--mk-border-thick--mk-rule-soft--mk-space-2--mk-space-3--mk-space-4--mk-space-5--mk-surface--mk-text--mk-text-2--mk-z-raised
Its own properties (1)
--mk-header-h
Changelog#
Arrived in 0.1.0.
Sectionwith its plate andArtslot,Plate,VolumeScope,PageHero,SectionHead,Eyebrow,Card,LineCard,InfoPanel,Stack,Cluster,Grid,Container,Main,Ruleand theFittedLineclient fitter;Navbarwith theNavDisclosuremega panels,Footer,FooterMap,BuildStamp,SkipLink,ActionDockandVisitorControls; theTableparts,ComparisonTablewith the one-tier switcher,SpecStrip,Numeral,Stat,StatGroup,StatusChip,BadgeandScoreDial;ProsewithmdxComponents,Quote,CodeBlockwithCopyButton,Figure,ScreenshotFrameandPhoneFrame; and the brand: the three evolved 2 × 2 options inmarkGeometry(a Overprint by default, b Paper seam, c Key block) with the pixel-snappedpxmode and the one-ink seam variant,logoGeometrywith the 1x clear-space frame,Mark,Wordmark,Logo,MaxosMarkandLineBadge. Read the whole entry- A ruler range keeps its two values apart, a slider's end figures stay inside it, ComparisonTable and the segmented ThemeToggle name their radios per instance (two on a page no longer uncheck each other), and a Stamp's second line wraps, with the big stamp at 0.6× below 30rem. Read the whole entry