Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

TCO Projection Pricing Block for React

A total-cost-of-ownership projection for a data lake: a one, three or five year switch redraws a line chart of each option's cumulative cost, beside the two plans you can buy with their totals and buttons.

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

Show buyers what a plan really costs over the life of a contract, with the buy buttons on the first screen. A Segment Group in the header row picks a one, three or five year horizon. Below it, one band between the page's rails holds a line chart of what Managed, Committed and building it yourself each cost, setup fees included, with a sentence under it stating the saving, and beside it the two plans you can buy. Each plan's total over the horizon rolls to its new amount with Sliding Number; the lowest-cost plan is tinted, tagged with an outline Badge and holds the only primary Shine Button. The chart is plain SVG and HTML in greys from the theme, and its lines draw in again whenever the horizon changes. Below lg a second segment group picks one plan at a time under the chart, with the lowest-cost plan shown first. Built with Segment Group, Badge, Guides, Sliding Number, Shine Button and Lucide icons, with CSS transitions only. For multi-year contracts and any product whose setup fees or long terms change the comparison.

FAQ

How do I change the plans and the cost model?

Edit the PLANS array: each plan has a monthly price, a one-off setup cost at the start, its terms line, and a cta label. A plan with no cta (the self-managed baseline) is charted but can't be bought. The featured plan gets the tinted row, the outline badge, the primary button and the thickest line. costAfter turns a plan into the cost after any number of months, and the chart, the totals and the saving sentence all use it, so a different model, such as yearly price rises or usage tiers, only needs a change there. HORIZONS lists the switch's options in years.

How is the chart drawn without a chart library?

Each plan's line is an SVG polyline with a point per month, in a 100 by 100 box stretched to the chart's size, with strokes that keep their width as it stretches. The gridlines, axis labels and end dots are HTML placed by percentage, so the text stays at its normal size on a phone. The cost axis picks a round step, such as $10k, so every gridline sits on its label. The lines are three greys from the theme, set per plan in TONES, so the lowest-cost plan's line is the heaviest and the primary colour stays on the one button.

Can screen reader users follow the projection?

Yes. The drawing is hidden from assistive technology, and the chart's caption says the same thing in words: "Cumulative cost over 3 years: Managed $43,200, Committed $34,200, Self-managed $39,600. Committed saves $9,000 over 3 years against Managed." The caption is a polite live region, so it's read again when the horizon changes, and only then. The horizon switch and the phone plan switch are radio groups with names, and each plan is an h3.

How does the plan switch on a phone work without the layout jumping?

Below lg the three plans share one grid cell and the ones you aren't looking at are invisible, so the panel always keeps the height of the tallest plan and nothing moves when you switch. Invisible plans are removed from tab order and from screen readers. From lg all three are shown as stacked rows and the switch is hidden.

How do I pass the chosen horizon to sales or checkout?

Each button is a real link to its plan's href. It's a ShineButton with render set to an a element and nativeButton={false}. Build the href from the horizon state, for example /contact?plan=committed&term=3, so your team knows whether the visitor was weighing one year or several.

When is a total-cost projection worth showing?

When the cheapest plan this month isn't the cheapest over the contract: setup fees, long terms or the cost of running it yourself shift the comparison over time, and buyers, often finance teams, compare totals rather than monthly prices. The self-managed line here is an estimate and is labelled as one under the band. For simple monthly plans with no fees, a billing toggle says the same in less space.

  • Pro

    An ROI calculator for a workflow-automation tool: sliders for team size and hours saved a week feed one display-size figure, the net savings a month, with the value of the time, the seat cost and the return under it.

  • Pro

    An itemised monthly bill for an accounting suite: full-width ledger rows with quantities, a subtotal, the annual discount and the total, which a billing switch recalculates, beside the plan it adds up to.

  • Pro

    A receipt that prices itself, for a webhook-delivery service: number steppers for seats, events and days of history drive a live bill that stamps the cheapest plan and itemises what goes past its allowance.

  • Pro

    Annual Savings Pricing

    Billing switches

    Three plans that show what yearly billing saves: each plan's head holds two bars, twelve monthly payments against one yearly payment, with the saving printed in the gap, under a monthly and yearly switch.

  • Pro

    Payment Schedule Pricing

    Billing switches

    Tuition paid once or in 3, 6 or 12 installments: four chips pick the schedule and a calendar of twelve monthly cells fills with the dated payments and their amounts, over the total and the call to action.

  • Pro

    Invoice Preview Pricing

    Comparison tables

    Three payroll plans as itemised monthly invoices: pick a headcount and each plan's bill adds up line by line, with its total and call to action at the top of its column.