A pricing-tier comparison table widget that extends the existing ComparisonTable component with pricing-specific features: tier-level pricing display, recommended-tier highlighting, badge support for labels like “Most Popular” or “Best Value,” and a per-tier CTA button. Designed for SaaS pricing pages and plan-selection flows.
Introduction
Overview
SaaS products need a standardized way to present pricing tiers side by side. The existing comparison-table.tsx handles generic feature matrices but lacks pricing headers, CTA buttons per column, and badge affordances. This widget wraps or extends ComparisonTable to add those capabilities.
Goals
Display pricing tiers with name, price, billing period, and optional badge.
Difficulty comparing plans when layouts differ across products
Definitions
Term
Definition
Tier
A pricing plan level (e.g., Free, Pro, Enterprise)
Feature matrix
Grid of features vs. tiers showing availability
Badge
A small label overlay on a tier header (e.g., “Most Popular”)
CTA
Call-to-action button at the bottom of each tier column
Current State
comparison-table.tsx exists with ComparisonColumn, ComparisonRow, and ComparisonTableProps interfaces. It renders a TanStack Table-based feature matrix with check/x/text cells and supports a highlighted flag on columns. It does not support pricing headers, badges, or per-column action buttons.
Proposed Solution
Create a PriceComparisonTable widget at src/components/widgets/price-comparison-table.tsx that:
Accepts PricingTier[] which extends ComparisonColumn with price, billingPeriod, badge, ctaLabel, and recommended fields.
Renders a pricing header row above the feature matrix with formatted prices and optional badges.
Delegates feature-row rendering to the existing ComparisonTable component.
Appends a CTA button row below the feature matrix.
Applies visual highlight (elevated background, ring) to the recommended tier column.
Requirements
The widget must compose with ComparisonTable rather than forking it. All pricing display is driven by props; no internal price calculation occurs.
Functional Requirements
ID
Requirement
Priority
FR-01
Render tier columns with name, price, and billing period in the header
Must
FR-02
Display an optional badge on any tier header
Must
FR-03
Visually highlight the recommended tier with distinct styling
Must
FR-04
Render the feature matrix using ComparisonTable rows
Must
FR-05
Display a CTA button per tier at the bottom of the table
Must
FR-06
Call onSelectTier(tierId) when a CTA is clicked
Must
FR-07
Support an optional subtitle per tier for additional context
Should
FR-08
Allow a custom-tier column (e.g., “Enterprise — Contact Us”) with no price
Should
FR-09
Support grouped feature rows via ComparisonRow.group
Should
Non-Functional Requirements
ID
Requirement
NFR-01
Renders up to 6 tier columns and 40 feature rows without layout issues
NFR-02
Full light/dark theme support
NFR-03
Bundle addition under 3 KB gzipped (leverages existing ComparisonTable)