Staaarter

Add-on List Pricing

A base plan card shows its price and core features, followed by a checklist of optional add-ons, each with its own name, description, and price. Checking add-ons updates an estimated monthly total at the bottom in real time, like a build-your-own-plan calculator.

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/addon-list-pricing.json

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

Usage

The file also exports pricing8Demo, 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 { Pricing8, pricing8Demo } from "@/components/blocks/pricing/pricing8";

export default function Page() {
  return <Pricing8 {...pricing8Demo} />;
}

Props

PropTypeDefaultDescription
headingReactNodeundefinedCentered headline above the plan card.
descriptionstringundefinedSupporting subtext below the heading.
basePlanBasePlannoneThe base plan's name, price, description, and core feature list. Required.
addonsAddonItem[]noneOptional add-ons, each with an id, name, description, and price. Required.
ctaLabelstringnoneLabel for the bottom CTA button. Required.
ctaHrefstringundefinedLink target for the CTA button.
classNamestringnoneExtra classes for the outer section element.

Types

type BasePlan = {
  name: string;
  price: number;
  period?: string;
  description?: string;
  features: string[];
};

type AddonItem = {
  id: string;
  name: string;
  description: string;
  price: number;
};

Behavior notes

  • The add-on checkboxes are real local state (a Record<string, boolean> keyed by addon id): checking or unchecking one immediately recalculates the estimated total shown at the bottom (basePlan.price plus every checked add-on's price).
  • No add-ons are pre-selected on load; the initial total always equals the base plan price alone.
  • The bottom CTA button is an inert placeholder (href defaults to "#" in the demo) with no real checkout wired up.