Staaarter

Comparison Table

A full feature-matrix table comparing 3-4 plan tiers row by row. Each row is a feature; cells show a Check/X icon for boolean support or a text value like "500GB" vs "Unlimited". Wrapped in a horizontally scrolling container so it stays usable on narrow screens.

By Staaarter Team
Pricing
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/comparison-table.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/pricing/pricing4.tsx instead.

Usage

The file also exports pricing4Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Pricing4, pricing4Demo } from "@/components/blocks/pricing/pricing4";

export default function Page() {
  return <Pricing4 {...pricing4Demo} />;
}

Props

PropTypeDefaultDescription
headingstringundefinedOptional section heading above the table.
descriptionstringundefinedOptional supporting text under the heading.
tiersComparisonTier[]noneColumn headers: one per plan, each with a price and CTA.
rowsComparisonRow[]noneTable rows, one per feature, with one value per tier aligned by array index.
classNamestringnoneExtra classes for the outer section element.

Types

type ComparisonTier = {
  name: string;
  price: string;
  period: string;
  cta: { label: string; href?: string };
  highlighted?: boolean;
};

type ComparisonRow = {
  label: string;
  values: (boolean | string)[]; // one entry per tier, aligned by index
};

Behavior notes

  • This is a fully static server component; nothing on the page changes at runtime.
  • The table sits inside an overflow-x-auto container with a min-width, so on narrow viewports it scrolls horizontally instead of squeezing columns unreadably.
  • A boolean value in a row renders as a Check icon (supported) or a dimmed X icon (not supported); a string value renders as plain text (e.g. a quota like "500GB").
  • Each tier's CTA button in the header row is an inert placeholder with href="#", no real checkout or navigation wired up.