Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Cost Breakdown Pricing Block for React

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.

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 a price that is built from parts as a bill. Under the section's header row, a Segment Group switches between monthly and annual billing. Below it, one band between the page's rails, with a + at each corner, holds the ledger: each line item (the plan, extra users, a payroll add-on, receipts storage) with its description, quantity and amount, then the subtotal, the annual discount in an outline Badge and the total due on a lightly tinted row, rolling to its new amount with Sliding Number. Across a divider, the plan the bill adds up to lists its features and holds the block's one primary Shine Button. On a phone the ledger comes first and the button rides a sticky bar with the live total, so it stays within reach. Built with Data List, Badge, Segment Group, Guides, Sliding Number, Shine Button and Lucide icons, with CSS transitions only. For accounting, payroll and any product whose price is a base plus add-ons, where showing every line earns trust before checkout.

FAQ

How do I change the line items, the discount and the plan?

Edit the LINE_ITEMS array at the top of the file. Each item has a label, a description, a quantity and a unitPrice; its amount is the quantity times the unit price. The subtotal, the discount and the total are worked out from that list and DISCOUNT_PERCENT, so they never disagree with the rows above them. BILLING holds the two options of the switch, CURRENCY is the symbol written before every amount and CURRENCY_CODE the label in the bill's corner. The plan's features are the FEATURES array of plain strings.

What does the billing switch change?

Only the discount. With annual billing chosen, which is the default, the discount row takes 20% off the subtotal, the total drops to match and the line under it reads "Billed annually as $1,080 a year". With monthly billing the discount row falls to $0 and the line reads "Billed monthly, cancel any time". The line items don't change. A polite live region reads the new total once for each change.

How do I connect the buttons to checkout?

Both call-to-action buttons are real links to the same place: the one in the plan panel from md up and the one in the sticky bar below md, where the panel's own button is hidden. It's a ShineButton with render set to an a element and nativeButton={false}. Point them at your checkout route with the quantities and the billing period in the query, for example /checkout?plan=business&users=3&payroll=8&billing=annual, and let your server rebuild the same line items from your price list before it charges anything: never trust amounts sent from the page.

How do screen readers read the bill?

The bill is a description list under its own h3, so each row is read as a term and its value: "Extra users, $8 per extra user, Quantity 3, $24". The multiplication sign is hidden and replaced by the word "Quantity", "/mo" is read as "per month", and the discount is read as "20% off" and "minus $22 per month" instead of a bare dash. The plan is an h3 under the section's h2, and its features are a list.

How does the layout adapt to phones and right-to-left pages?

From the lg breakpoint the bill and the plan sit side by side, the bill a little wider, split by a rule; below it they stack, bill first, under a single rule. Below md the plan panel drops its button and a sticky bar at the bottom of the section carries the total and the button instead. Amounts use tabular figures and a shared minimum width, so the right-hand column lines up, and each amount with its sign and unit, such as "−$22/mo", is kept in one left-to-right run so it doesn't break apart on a right-to-left page.

When should I use a cost breakdown instead of plan cards?

Use a breakdown when the price is built from several parts, such as users, payroll and storage: showing each part and the discount earns trust before the visitor reaches checkout. Plan cards suit fixed tiers, where itemising a single price would only add noise.

  • 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.

  • Pro

    A product-led split: a mock of the app built from our own components with numbered callouts on it, matching a 'what you get' list, beside the one plan as a card in a card with a monthly and yearly switch.

  • Pro

    A CRM sold as a base plan plus six add-ons that switch on and off in cells sharing hairlines, with the price per seat rolling big beside them and a sticky total bar on phones.

  • Pro

    Seat-type pricing with a stepper for each type: Full, Collaborator and Viewer seats at different prices, a stacked bar of the seat mix, a live monthly total and, on a phone, a sticky total bar.

  • Pro

    One plan in the spotlight: an oversized card under a monochrome cone of light with the price as the largest type on the page, a monthly and yearly switch, and a short pitch beside it.

  • Pro

    Billing Toggle Pricing

    Billing switches

    Three plan cards under a monthly and yearly switch that wears its saving in the header row, with prices that roll to their new amount and each plan a card in a card.