shadcn.io is not affiliated with official shadcn/ui
Order Confirmation Billing Block for React
A confirmed hosting order told by when each charge happens: today, after the trial and at renewal, each line with a Why button that writes its arithmetic (prorated days, seat prices, tax) into one held band, and totals worked out from the lines.
Installation
Overview
Confirm an order by saying when the money moves, with this order confirmation for React with Base UI. Inside a hairline frame with a plus mark on each corner, a header band shows a check in a muted tile, the order number and the amount charged today as the biggest figure. Under it, three hairline columns, Today, After the trial and At renewal, each with its date, its lines and a total worked out from them: the plan and five seats prorated for the days left in the cycle plus tax today, a free trial that costs nothing, and the full plan and seats plus an add-on that starts at renewal. Every line has a ghost Button, "Why", that writes the arithmetic behind its amount (days over days in the cycle, seat price times seats, the tax rate) into one band under the columns, which keeps its height whichever line you ask about. The only Shine Button opens the workspace. The bands are ruled by Guides and the foot is pinned on a phone, where the columns stack. It's built from Button, Shine Button and Guides, with a CSS entrance only. For the page after a purchase in products that bill in stages.
FAQ
How do I fill it with my order?
The constants at the top hold the plan: PLAN_CENTS, SEAT_CENTS and SEATS, the add-on's price, LEFT and CYCLE (the days remaining and the cycle's length, for the proration), TAX_PERCENT and the three dates. The lines in WHENS are built from them, along with each line's explanation, and the totals are sums of the lines, so changing a price changes every figure that depends on it.
How is the proration worked out?
A monthly price times the days remaining over the days in the cycle, rounded to the cent, as the Why text for each line shows. Tax is the rate times that column's subtotal, rounded once. The header's "Charged today" is the Today column's total, so it can't disagree with the lines below it.
Why one band for every explanation?
So asking never moves anything. If each line opened its own text, the columns would grow and push the button down. Here "Why" fills a band of fixed height under the columns, the line you asked about is marked as pressed, and a polite status message says what is showing.
What stays local?
Nothing is provisioned or charged: the button says "Workspace opened in this demo." Wire it to a link to the workspace your server created, and send the order number to your receipt email. Show the card brand and the last four digits only; collect and store cards only in your payment provider's hosted fields.
Related
- Upcoming Invoice Preview BillingInvoices and receipts
- Pro-Rated Calculation BillingUpgrade and downgrade
- Checkout Summary BillingCheckout and pricing
- Payment Success Confetti BillingInvoices and receipts
- Account Restored Invoice SuccessPayments and refunds
- Abandoned Checkout Alert BillingCheckout and pricing