WebberUI

Feature Compare Matrix

A plan feature comparison table with a sticky first column and header, highlighted difference rows, and animated checks and crosses.

This is a WebberUI Pro component

Free during the launch campaign: sign up or sign in, then hit “Copy install command” in the preview above and it installs straight away — no payment, no credit card. The command below returns 401 while you are signed out.

How to install Pro components →See the plans →

A complete plan feature comparison section: both the feature name column on the left and the plan row along the top are sticky, so you never lose your place while scrolling. Cells support stroke-animated checks/crosses as well as text values, rows reveal with a stagger, the "Differences only" control in the top-right filters out rows where every plan is the same (with a collapse-and-fill animation), and the recommended plan gets an accent background down its entire column.

Loading preview…
npx shadcn@latest add "https://webberui.com/r/feature-compare-matrix.json?t=<install token>"

Playground

Tune the props live — the code snippet updates as you go, so you can dial in the look you want before copying it.

440
<FeatureCompareMatrix />

Installation

npx shadcn@latest add "https://webberui.com/r/feature-compare-matrix.json?t=<install token>"

Or, once registries are configured in components.json, install it as @webberui/feature-compare-matrix.

Usage

import { FeatureCompareMatrix } from "@/components/ui/feature-compare-matrix";

<FeatureCompareMatrix
  plans={[
    { name: "Starter", price: "NT$0" },
    { name: "Pro", price: "NT$320/mo", highlighted: true },
  ]}
  features={[
    { label: "Custom domain", values: [false, true] },
    { label: "Version history", values: ["7 days", "Unlimited"] },
  ]}
/>

Props

PropTypeDefaultDescription
plansComparePlan[]List of plans (the table's columns); 2–4 is recommended
featuresCompareFeature[]List of features (the table's rows)
showDiffTogglebooleantrueWhether to show the "Differences only" toggle in the top-right corner
defaultDiffOnlybooleanfalseDefault state of "Differences only"
maxHeightnumber440Maximum height of the scroll area (px); past that it scrolls vertically while the header stays sticky
classNamestringForwarded to the outermost container

ComparePlan:

FieldTypeDescription
namestringPlan name, shown in the header
pricestring?Price text, shown below the plan name
highlightedboolean?Recommended plan: accent background down the whole column plus a "Recommended" badge in the header

CompareFeature:

FieldTypeDescription
labelstringFeature name, shown in the sticky first column
values(boolean | string)[]Value for each plan, in the same order as plans: a boolean renders a check/cross, a string renders text, and a missing value counts as not included

Accessibility

  • The table marks up its structure with the ARIA roles table / row / columnheader / rowheader / cell, and the check and cross icons carry additional sr-only text ("Included" / "Not included") for screen readers
  • The "Differences only" toggle is a role="switch" reporting its aria-checked state
  • The scroll area is keyboard focusable (tabIndex=0 with an aria-label), so the table can be scrolled with the arrow keys
  • When the user has "reduce motion" enabled at the system level, the row-by-row reveal, the check/cross stroke animation, and the collapse-and-fill animation are disabled and the content is shown complete right away

On this page