Staaarter

Two-Plan Comparison Table

A side-by-side comparison table for two plan tiers (e.g. Free vs Premium), each with its own header cell showing the plan name, price, and an upgrade button. Each feature row renders either a check/cross icon for included/excluded, or a plain text value like a usage limit.

By Staaarter Team
Feature
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/two-plan-comparison-table.json

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

Usage

The file also exports feature133Demo, 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 { Feature133, feature133Demo } from "@/components/blocks/feature/feature133";

export default function Page() {
  return <Feature133 {...feature133Demo} />;
}

Props

PropTypeDefaultDescription
eyebrowstringundefinedSmall label above the heading; omitted entirely when unset.
headingstringnoneSection heading.
descriptionstringundefinedSupporting copy under the heading.
plans[ComparisonPlan, ComparisonPlan]noneExactly two plans, rendered left (e.g. Free) and right (e.g. Premium).
rowsComparisonRow[]noneFeature rows; each cell is either a boolean (renders a check/cross icon) or a string (renders as plain text).
classNamestringundefinedExtra classes for the outer section element.

Types

interface ComparisonPlan {
  name: string;
  price: string;
  period?: string;
  cta: { label: string; href: string };
}

interface ComparisonRow {
  label: string;
  free: boolean | string;
  premium: boolean | string;
}

Behavior notes

  • Plain server component, no interactivity; the plan CTA buttons are inert links (`href="#"` in the demo).
  • Uses a real `<table>` with `<thead>`/`<tbody>` and `scope="col"` header cells, not styled divs, so the comparison is announced correctly by screen readers.
  • Check and cross marks use semantic tokens only (`text-primary` for included, `text-muted-foreground/40` for excluded), never a literal green or red class.
  • The second plan's header button renders with the default (filled) button variant to read as the recommended upgrade; the first plan's uses the outline variant. This is a purely positional convention, not tied to plan identity.