Community project. This is not an official government website.

Run by volunteers. Lampung Design System is built by an open source community. No government agency runs or endorses it.

Official services use go.id. Government websites in Indonesia end in .go.id. Never enter your national ID number on a site you are unsure of.

Compare table

Compare table

Plans as columns and features as rows, grouped by topic, with a check, a dash icon or a short value in each cell. It scrolls sideways in its own box while the feature names stay put.

Usage

Use it when

  • Under the plan cards on a pricing page, for people who want every difference before they buy.
  • Comparing two to four editions of a product by the same list of features.

Use something else when

  • Choosing a plan: use Plans.
  • Records compared by attributes (students, invoices): use Table.
  • Label and value pairs of one item: use Key-value.

Where it goes. Under plans, often behind a "Compare every feature" button that opens it in place with the collapse recipe. Full content width; from 620 px it fits, below that it scrolls inside .compare-box with the feature column sticky on the left.

Examples

Two groups, three plansNarrow the window: the plans scroll under the feature names.
Compare plans
FeatureFree$0Teacher$12 a monthSchool$9 per teacher
Classes
Classes2Unlimited
RubricsNot includedIncluded
Support
Email supportNot included1 business day
<div class="compare-box" data-lds-fade style="width: 100%;">
  <table class="compare">
    <caption>Compare plans</caption>
    <thead><tr><th scope="col">Feature</th><th scope="col">Free<span class="compare__price">$0</span></th><th scope="col" class="is-featured">Teacher<span class="compare__price">$12 a month</span></th><th scope="col">School<span class="compare__price">$9 per teacher</span></th></tr></thead>
    <tbody>
      <tr class="compare__group"><th scope="rowgroup" colspan="4">Classes</th></tr>
      <tr><th scope="row">Classes</th><td>2</td><td class="is-featured">Unlimited</td><td>Unlimited</td></tr>
      <tr><th scope="row">Rubrics</th><td><span class="ic compare__no" aria-hidden="true">remove</span><span class="sr-only">Not included</span></td><td class="is-featured"><span class="ic" aria-hidden="true">check</span><span class="sr-only">Included</span></td><td><span class="ic" aria-hidden="true">check</span><span class="sr-only">Included</span></td></tr>
      <tr class="compare__group"><th scope="rowgroup" colspan="4">Support</th></tr>
      <tr><th scope="row">Email support</th><td><span class="ic compare__no" aria-hidden="true">remove</span><span class="sr-only">Not included</span></td><td class="is-featured">2 business days</td><td>1 business day</td></tr>
    </tbody>
  </table>
</div>

Anatomy

PartWhat it is
.compare-boxRequired. The scroll box (positioned, so screen-reader-only text stays inside it).
table.compareRequired. A real table with a caption.
thead thThe plan names; .compare__price under each name.
tr.compare__group > th[scope="rowgroup"]A group heading row spanning all columns.
tbody th[scope="row"]The feature name.
tdA check icon, a remove icon with .compare__no, or a short value ("All 143", "3 to 50"). Icons carry .sr-only text.
.is-featuredOn every cell of the recommended plan's column: the quiet fill, rounded at the ends.

States

StateHow
narrowBelow 760 px the feature column is sticky on the canvas color; scroll fades (data-lds-fade) show there is more to the right.
period changeInside a [data-lds-billing] element the header prices can morph with the period like the plan cards.

Motion and microinteractions

  • Static. Opened in place with the collapse recipe (grid-template-rows 0fr to 1fr on --spring-smooth), never a page jump.

Accessibility

  • A real <table> with a caption, scope="col" on plan headers, scope="row" on feature names and scope="rowgroup" on group rows.
  • Check and dash icons are aria-hidden with "Included" or "Not included" in .sr-only text.
  • The scroll box is reachable by keyboard through the cells it contains; it never makes the page scroll sideways.

Do and don't

Do

  • Write limits as words or numbers ("3 to 50") instead of a check when they differ.
  • Group rows by what buyers ask about: features, platforms, license, support.

Don't

  • Use color alone for included and not included.
  • Repeat every line of the plan cards; the table is for the full list.