Skip to content
Knowns UI
Get ProSign in

Order Summary

What the person is about to pay for: the lines with quantity, a promo code, the discount, the tax and the total due, with a note on what renews. Amounts are cents; the code check is your callback.

On this page
Used for
  • Checkout sidebar
  • Plan change review
  • Cart
  • Invoice preview

Examples

Tax

Installation

npx knowns-ui@latest add order-summary
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

lines
{ id, name, detail?, amount, quantity? }[]
What is bought. amount is the price of one, in cents.
currency / locale
string
Default"usd" / "en-US"
How money reads.
promo / onPromoChange
Promo | null / (promo) => void
The applied code, controlled. Leave it out and the summary keeps its own.
onApplyPromo
(code, signal) => Promise<Promo>
Checks a code. Resolve with { code, label?, percentOff? | amountOff? }; throw an Error with the reason to refuse it. Without it there is no code field.
tax
{ label, rate?, amount?, inclusive? } | null
A rate on the discounted subtotal, or a fixed amount from your provider. inclusive shows it without adding it.
taxNote
ReactNode
Default"Calculated at payment"
Shown in the tax row when there is no tax line.
totalLabel / note
string / ReactNode
Default"Due today" / -
The total's label and a line under it about what renews.
title / surface
ReactNode | null / boolean
Default"Order summary" / true
The heading, and whether it draws its own card.

Accessibility

  • The totals are a description list, so each amount is read with its label.
  • Enter in the code field applies it; Escape closes the field and focus goes back to Add promo code.
  • A refused code is announced (role alert) and focus stays in the field to fix it.
  • The remove button on the chip is named after the code: Remove LAUNCH40.

What it handles

  1. 01Lists what is being bought with quantity and a second line, and adds it up in cents so the total never drifts.
  2. 02Opens a promo code field from a quiet link, checks it through your callback with an AbortSignal, and shows why a code was refused.
  3. 03Shows an applied code as a chip you can remove, with its discount row, and never discounts past the subtotal.
  4. 04Adds tax from a rate or a fixed amount, shows tax that is already included, or says it is worked out at payment.
  5. 05Ends on the total due and a line on what renews and when.

States

First render
Nothing moves
none
Add promo code
The field folds open
180ms, ease out
Checking a code
The Apply button spins
until it answers
Code refused
The reason shows under the field
none
Reduced motion
The field opens at once
0ms

Works with

When to use

When to use

  • The lines, promo code, tax and total beside a pay step or a plan change.
  • A cart or an invoice preview before the person commits.

When not to use

  • The whole checkout with the payment and the receipt: use Checkout.
  • Comparing plans: use Pricing.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Order Summary to my app and wire it to my own data.
  • I need the lines, promo code, tax and total beside a pay step or a plan change. Set that up with the Knowns UI Order Summary.
  • Which Order Summary props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "order-summary" }) and search_docs({ query: "order summary" }).

Need help?

Stuck on Order Summary, or found something off? We read every message.