Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Comparison Table Pricing Block for React

Four plans compared feature by feature in one table whose hairlines meet the page rails, with a billing switch, a tinted popular column and, on a phone, a plan switch that keeps the feature column beside one plan.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Compare every feature across four pricing tiers in one side-by-side table, for React with Base UI. A compact header puts the headline and one sentence on the left and a Segment Group billing switch on the right, and the table runs the full width of the page column below it, its hairlines meeting the side rails with a plus mark on each corner, drawn by Guides. The first row is the plans: each column opens with its name, who it's for, its price per user and a Shine Button call to action, so a buyer sees what to click before a single feature. The prices roll to their new amount with Sliding Number when the billing period changes. Twenty feature rows follow in four groups, Planning, Collaboration, Automation and Security and support, with a check for an included feature, a dash for a missing one and the limit where there is one. The Team column gets an outline Popular Badge, a light tint down its cells and the one primary button. Below the md breakpoint a second Segment Group picks one plan, and the table keeps the feature names beside that plan's column, so nothing scrolls sideways. Built with Table, Segment Group, Sliding Number, Badge, Shine Button, Guides and Lucide icons, with CSS transitions only. For SaaS pricing pages, B2B plan comparisons and any pricing story where buyers check feature parity row by row before they commit.

FAQ

How do I change the plans and the feature rows?

Edit the two arrays at the top of the file. PLANS holds each plan's name, tagline, call to action and href, its prices per user a month for each billing period ({ annually, monthly }), and whether it's the popular one; a price of 0 shows "Free" and null shows "Custom". GROUPS holds the sections, each with its features: a feature has a name and a value per plan id, true for a check, false for a dash, or text for a limit such as "Up to 100". Add a plan and TypeScript points at every feature that still needs a value for it.

How do I send the calls to action to checkout or a sales form?

Each call to action is already a link: point it at your checkout with the plan and the billing period in the address (/checkout?plan=team&billing=annually, from the plan's id and the switch's value), and the Enterprise one at your contact form. Change the href in render={<a href={plan.href} />}; nativeButton={false} tells Base UI the element isn't a button.

Is the comparison table accessible to screen readers and keyboard users?

Plan names are column headers, feature names are row headers and each group's name heads the rows under it, so a screen reader reads "Team, SAML single sign-on, not included" rather than an empty cell: every check and dash carries hidden text ("Included", "Not included"). The table is named by the section's heading, prices are read with their period ("$10 per user per month") and each call to action says which plan it's for. Both switches are radio groups: the arrow keys move and select.

How does the comparison table work on a phone?

Below md the plan switch appears over the table, with the popular plan selected, and the table shows the feature column and that one plan. The calls to action and the first rows are on the first screen, and switching plan swaps the column without moving the page. The full table and the one-plan table are both rendered from the same data, and the one not in use is display: none, so assistive technology meets only one. From md all four plans fit and the switch is hidden.

How do I highlight a different plan?

Set popular: true on that plan and false on the others, and give the shown state its id, so a phone starts on it. Its column gets a light grey tint on every cell, the Popular badge and the solid call to action, the block's one primary button; the other plans use the outline style. They're all theme tokens, so the highlight follows your theme and dark mode.

When should I use a comparison table rather than plan cards?

Use a comparison table when you have many differentiating features across three or more plans and buyers need to check them row by row: the grouped rows make collaboration, automation and security differences quick to scan. Plan cards work better for consumer products with short feature lists, where visitors choose on price and a few highlights rather than feature parity.

  • Pro

    A long comparison you fold by group: four API-gateway plans over thirty-four features in five groups, each group a header row you press to open, with one open at first and per-plan counts when closed.

  • Pro

    Feature Matrix Pricing

    Comparison tables

    A feature matrix you can interrogate: search the features, hide the rows every plan shares with a switch, and watch a live count in the table's corner, over four chat plans and twenty-eight features.

  • Pro

    Billing Toggle Pricing

    Billing switches

    Three plan cards under a monthly and yearly switch that wears its saving in the header row, with prices that roll to their new amount and each plan a card in a card.

  • Pro

    Three virtual-server plans laid out like a technical datasheet on the page column: a column per plan with its size, price and call to action, then grouped rows of monospaced specs on shared hairlines, and a plan switch on phones.

  • Pro

    Feature Heatmap Pricing

    Comparison tables

    A feature heatmap that grades three course-platform plans from 0 to 3 on seventeen features in greys, with the legend in the header row, plan prices and calls to action as the first row, and a plan switch on phones.

  • Pro

    Compare Tray Pricing

    Comparison tables

    A comparison tray for four plans: tick any two or more and the tray opens as a side-by-side table of just those plans, with their prices and calls to action at its head.