Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Invoice Preview Pricing Block for React

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.

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 line-item price transparency with this invoice preview pricing section. A compact header, a heading and one sentence with a Segment Group of headcounts on its right (10, 25, 50 or 100 employees), sits over one table framed between hairlines with a + mark on each corner, under the page's top rule and side rails drawn by Guides. Its columns are three payroll plans, Core, Plus and Premium. Each column opens with its name, its monthly total, rolling to the new sum with Sliding Number when the headcount changes, and a Shine Button call to action. Below, the rows are the lines of the bill, grouped under Platform, Add-ons and Support bands: a flat platform fee, the employees multiplied out ("25 × $9"), the add-ons each plan includes, charges or lacks, and a support tier. The same sum closes the table as a Monthly total row. The recommended Plus column carries a soft tint, a Best value outline Badge and the one primary button. On a phone the table becomes plan tabs over one invoice at a time, with its total and button first. Built with Table, Segment Group, Sliding Number, Badge, Shine Button, Guides and Lucide icons, with CSS transitions only. For payroll, HR and any product whose bill is a platform fee plus a per-person price and a few add-ons.

FAQ

How do I change the line items, the plans and the prices?

Edit the arrays at the top of the file. PLANS holds each plan's name, tagline, call to action and whether it's the popular one, and HEADCOUNTS the choices in the headcount switch. GROUPS holds the bands, each with its lines: a line has a label, a unit description and a value per plan id. A value is a charge, { flat, perEmployee, note }: flat is a monthly amount, perEmployee an amount multiplied by the headcount, note what the line covers ("5 included"), and any of them can be left out; null draws a dash for a plan that doesn't have the line. Add a plan and TypeScript points at every line that still needs a value for it.

How are the totals worked out?

They're added up, not typed in: totalOf sums every line's flat and perEmployee × headcount for a plan, so at 25 employees Plus is $79 + $225 + $75 + $25 = $404 and the figure at the top of its column always agrees with the Monthly total row at the foot. Lines with only a note add nothing. Change a rate and both totals follow, and the headcount switch rolls them to the new amount.

How does a screen reader read the invoice?

Plan names are column headers, line names are row headers (with their unit) and each band's name heads the rows under it, so a cell reads as "Plus, Employees, $225, 25 × $9"; a dash reads "Not included". The table is named by its headcount ("Monthly invoices for 25 employees"), the headcount switch is a radio group that arrow keys move through, and each call to action names its plan, as in "Start free month, Plus plan". Totals are plain text under the rolling digits, so they are read once, in full.

How does the table work on a phone?

Below the md breakpoint the table gives way to a second view of the same data: a Segment Group of the three plan names, with the recommended plan selected, over one plan's invoice as a list of lines with its total and call to action at the top. Nothing scrolls sideways. The headcount switch stays above both views, so changing it updates whichever invoice is showing.

How do I highlight a different plan, or connect the buttons?

Set popular: true on that plan and false on the others: its column gets the soft tint, the Best value badge and the primary call to action. The phone tabs open on Plus, set by the initial useState. Each call to action is a link: point its href at your checkout with the plan and headcount (/checkout?plan=plus&employees=25) and Premium at your sales form. It's a ShineButton with render set to an a element and nativeButton={false}.

When should I show an itemised invoice instead of a feature table?

Show the invoice when a plan's price is made of several parts (a platform fee, a price for each person, add-ons, a support tier) and buyers ask where the money goes: watching each line add up to the total builds trust, and the headcount switch answers "what will it cost for us?" without a calculator. Use a feature comparison table when plans differ by what's included rather than by what each part costs.

  • 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

    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

    Platform Fee Pricing

    Sales and partners

    A maker marketplace's take rates in four ruled tier rows: each percentage at display size over a bar that shrinks with it, with the plan fee, the sales it pays off from and the payout speed.

  • Pro

    A long comparison you fold by group: four API-gateway plans over thirty-four features in five groups, each group a header row you press to open, with one open at first and per-plan counts when closed.

  • Pro

    Comparison Table Pricing

    Comparison tables

    Four plans compared feature by feature in one table whose hairlines meet the page rails, with a billing switch, a tinted popular column and, on a phone, a plan switch that keeps the feature column beside one plan.

  • Pro

    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.