Back to blocks
BlockeCommerceFree

Product Comparison Table React component

A side-by-side product comparison with a sticky header of photos, prices, ratings and Add to cart buttons, collapsible spec groups, yes/partly/no marks, bars and Best badges for measured specs, a Show differences only switch, column hover, removable and re-addable products, and a sticky first column when it scrolls sideways on phones.

About the Product Comparison Table component

Product Comparison Table lines up similar products so shoppers can see the trade-offs at a glance. Product photos, prices and Add to cart stay pinned at the top while the specs scroll underneath.

Measured specs get bars and a Best badge, yes-or-no features get clear marks, and a single switch hides everything the products have in common so only the real differences remain. Products can be removed and added back to narrow the choice.

When to use it

Use it for categories where people compare specs before buying, such as electronics, appliances, mattresses or subscription plans, on a compare page or below a product family.

Keep it to two to four products. With more columns the table gets hard to scan, especially on phones; let shoppers pick what to compare instead.

Installation

Add the Product Comparison Table component to your project with the shadcn CLI. It lands in components/product-comparison-table.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/product-comparison-table

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

Related components

Shipping Estimator
Free
Low Stock Urgency Badge
Free
Back-in-Stock Notify
Free
SEO-ready
Meet the Team
$4
Stat Feature
Free
Feature Split Section
$4