Skip to content

Product comparison

Tick two or three products to compare them side by side in an accessible table, with no reload.

  • Tailwind
  • React
  • CSS
  • WordPress
Open in a new tab

Description

Under a list of similar products (here four e-bikes), each card has a “Compare” box. Once two products are ticked, a table appears with their features in columns: price, range, weight, motor, warranty. Beyond three, the other boxes are disabled and a message explains why; unticking frees a slot. The full table is written in the page: without JavaScript it shows in full, and the script only hides the columns not chosen, which keeps it indexable by search engines. Semantic table with a caption and row and column headers (scope), a horizontally scrollable area reachable with the keyboard on small screens, a status message announced politely. 44 px tall boxes, AA contrast in light and dark mode, cards on one column at 360 px. The maximum is set with data-cpp-max.

Code

Loading the code…

The code of this component in

Archive contents

comparateur-produits-html-tailwind.zip3 files · 5 Ko

  • index.html11 Ko
  • README.md3 Ko
  • LICENSE.md1 Ko

Tags

Updated on December 2, 2026.

Reviews

No reviews yet.

In the same spirit

  • A limited-time offer bar: countdown to a fixed date, one-click copyable promo code and a fallback message once the offer is over.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A sales card showing the discount that grows with the cart amount (-10% from €50, -15% from €100…) with a progress bar towards the next tier.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A Christmas gift guide filtered by budget and theme, with the number of ideas announced and an empty state offering to show everything again.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • The last order dates for delivery before Christmas, per shipping method, with the days left worked out from the visitor’s date.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component