Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Feature Matrix Pricing Block for React

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.

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

Let buyers find the one row they came for with this filterable feature matrix, for React with Base UI. A compact header holds the headline and one sentence on the left and two controls on the right: a search field made from an Input Group with a magnifier and a clear button, and a Switch labelled "Show only differences". Type and the rows narrow to the features whose name, or whose group's name, contains your words; turn the switch on and the seven of 28 rows that read the same on all four plans disappear, so only the differences are left. A live count, "21 of 28 features", sits in the table's top-left corner, where the empty cell used to be, and every group header carries the number of rows it still shows. Below the controls one Table spans the page column between its rails, drawn by Guides with a + mark on each corner. Its first row is the plans: names, taglines, prices per user and Shine Button calls to action, with a Best value Badge, a light tint and the only primary button on the Plus column. If nothing matches, a row says so and offers a button that clears both controls. Below the md breakpoint a Segment Group picks one plan, and the matrix keeps the feature names beside that plan's column. Built with Table, Input Group, Switch, Segment Group, Badge, Button, Shine Button, Guides and Lucide icons, with CSS transitions only. For SaaS with a long feature list, enterprise buyers checking one capability, and any pricing page where scanning 28 rows is too much.

FAQ

How do I change the plans, groups and 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 monthly price per user (0 shows "Free", null shows "Custom") and popular for the tinted, badged column. GROUPS holds the sections, each with its features: a feature has a name and a value per plan id in values, true for a check, false for a dash, or text for a limit such as "Up to 50". Add a plan and TypeScript points at every feature that still needs a value for it. The counts, the differences filter and the group numbers all read from those arrays.

How do the search and the differences switch work together?

Both narrow the same list. narrow keeps a feature when it matches the search and, with the switch on, when its values aren't identical on every plan; groups left with no rows disappear. The search is a case-insensitive substring match on the feature's name and its group's name, so "security" shows the whole Security group. Escape clears the field and keeps focus in it. To search the values too, add String(value) checks to the filter in narrow.

Is the filtered count announced to screen readers?

Yes, a moment after typing stops: a polite live region says "12 of 28 features" or "No features match", so a screen reader user hears the result of a search without being interrupted on every key. The count in the table's corner is for sighted users and is hidden from assistive technology, so it isn't read twice. The switch is named for what it does ("Show only differences, hiding rows that are the same on every plan").

How do I connect the plan buttons to checkout?

Each call to action is already a link: point its plan's href at your checkout with the plan in the address (/checkout?plan=plus), and Enterprise's at your sales form, then let your server map the plan to your payment provider's price. The link is render={<a href={plan.href} />} on ShineButton, with nativeButton={false}.

Is the feature matrix 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 "Plus, SAML single sign-on, included" rather than an icon: every check and dash carries hidden text. The table is named by the section's heading and each call to action says which plan it's for. The search field has a label, the clear button is named, and every control is reachable in reading order.

How does the feature matrix work on a phone?

The search field takes the full width and the switch sits under it, then a plan switch (a radio group) picks one plan with the popular one selected, and the table shows the feature names beside that plan's column. The call to action is in the first screen, nothing scrolls sideways, and filtering works exactly as on a desktop. The full table and the one-plan table are rendered from the same data, and the one not in use is display: none, so assistive technology meets only one.

  • Pro

    Comparison Table Pricing

    Comparison tables

    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.

  • 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 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

    Feature Diff Pricing

    Comparison tables

    One upgrade shown value by value: the price and call to action in one column, and in the other a ruled ledger with the Free limit struck through beside the Pro value on every row.

  • 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.

  • Pro

    Self-hosted against cloud for a code host: two compact heads with their prices and buttons, over a nine-row matrix that marks the stronger side of each row.