Drafts · CardsExperiment

Role tier card

A role tier card pair introduces two tiers of one category side by side, for example Standard and Administrator, and links on to the full comparison table.

How to add a card pair to a page. The file is components/css/role-tier.css.

Basic Usage

Link the shared stylesheets once per page. Never copy the rules into a page.

StepWhat to do
1. Link<link rel="stylesheet" href="/components/css/role-tier.css"> and badge.css. The page also needs the Material Symbols font.
2. PairOne .role-tier-pair with two .role-tier cards. Add role-tier--dark to the second.
3. ContentBadge row, name, description, link and three or four .role-tier__feature rows, taken from the comparison table.
4. Link logicAdd goToCompareView() (below) to the page and call it from each link.

Role tier card

Copy the markup you need.


API

Classes

ClassUse
role-tier-pairThe grid that holds two cards.
role-tierA card. The base tier.
role-tier--darkThe extended or administrative tier.
role-tier__linkThe action link. data-state="hover" forces hover (docs only).
role-quicklinks, role-quicklinkA row of small links above the cards.

Things to know

  • The card changes at 640px and at 769px.
  • The link needs the table’s own script (setCompareView()). Without it, only the scroll works.
  • The dark card’s feature line is the one value without a token (white at 12%).

CSS / Tailwind

The component is one CSS file, shared by every page. Link it, never copy it. The CSS below is read from the file the page links, so it is always what you see.

CSS (components/css/role-tier.css)