Billing Feature Comparison Table
A feature-by-feature comparison table for pricing pages with more than one plan. Each feature row can hold a boolean (rendered as a check or a dash) or a plain value like a limit or a duration, one plan can be marked highlighted for a tinted column that runs from the header through the footer, and the whole table scrolls horizontally on narrow screens instead of collapsing.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge, button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-feature-comparison-table.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing58.tsx instead.
Usage
The file also exports billing58Demo, 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 { Billing58, billing58Demo } from "@/components/blocks/billing/billing58"; export default function Page() { return <Billing58 {...billing58Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Compare plans" | Heading above the table. |
| description | string | none | Supporting sentence under the heading. |
| plans | ComparisonPlan[] | none | Columns of the table, rendered in the order given. |
| features | ComparisonFeature[] | none | Rows of the table, rendered in the order given. |
| ctaLabel | string | "Choose plan" | Label on every plan's footer button. |
| className | string | none | Extra classes for the outer wrapper. |
Types
interface ComparisonPlan { id: string; name: string; price: string; badge?: string; highlighted?: boolean; ctaHref?: string; } interface ComparisonFeature { id: string; label: string; values: Record<string, boolean | string>; }
Behavior notes
- Each feature's values map is keyed by plan id; true renders a check icon, false or a missing key renders a dash, any string renders as plain text for numeric or tiered limits.
- Setting highlighted: true on a plan adds a tinted background and a side border that spans the header cell, every body cell in that column, and the footer cell.
- The table sits in an overflow-x-auto wrapper with a min-width on the table itself, so it scrolls horizontally on narrow viewports instead of reflowing into cards.
- Rows get a subtle background tint on hover to help someone visually track a feature across columns on a wide table.
- Every plan's footer button is a next/link styled as a button, not a real submit, wire ctaHref (or replace it with an onClick) to your actual checkout or plan-switch flow.
Frequently asked questions
More Billing Blocks
View all →Billing Invoice List
Invoice history table with status badges, formatted amounts, and a per-row download link, built with shadcn/ui and Tailwind CSS.
Billing Failed Payment Alert
High-contrast failed-payment alert with a message, a retry button, and an optional update-payment-method button, built with shadcn/ui and Tailwind CSS.
Billing Credit Balance
Compact credit balance card with a large total, an optional purchased-versus-promotional breakdown, a low-balance notice, and a top-up button.
Billing Payment Methods
A saved payment method list for React and Next.js with brand icons, a default badge, near-expiry warnings, and remove/set-default actions per row.
Billing Add Card
A card entry form for React and Next.js with auto-formatted fields, internal brand detection, and per-field validation feedback built with shadcn/ui and Tailwind CSS.
Billing Coupon Code
An inline promo code input for React and Next.js with a simulated loading state, an applied summary showing the discount amount, and an invalid-code message.