Skip to content
Calm motion: animations on this site only fade, with no movement

Order summary ​

The lines of an order, then the sums and the total

Shows what a person buys and what they pay, next to a checkout form. For the plans of a service, use the pricing table.

Basic

Order summary

  • Home Studio hoodieSize M · BlackQty 1
    $48.00
  • Pop filterQty 2
    $24.00
  • Sticker packSeason oneQty 1
    $6.00
Subtotal
$78.00
Discount (LISTENER10)
−$7.80
Shipping
Free
Tax
$5.83
Total
$76.03
  • lines is a list of lines. Each line has an id, a name, the price of one, and a quantity. It can also have a note, such as the size, and an image. The line shows the price times the quantity.
  • Under the lines, the summary shows the subtotal, the discount with its discount-label, the shipping, the tax, and the total. A shipping of 0 shows "Free". With no shipping, discount, or tax, the row does not show.
  • The total is the subtotal less the discount (never below zero), plus shipping and tax.
  • currency is an ISO code (default USD), and locale sets the format of the money (default en).
  • The footer slot holds your button. It gets { total }.
  • The summary is a region named by its title. Change the words with labels or a label pack: title, subtotal, discount, shipping, free, tax, total, and quantity (a function of the count).

Usage ​

ts
import { BlessOrderSummary } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
lines*BlessOrderLine[]—
currencystring"USD"an ISO code, for example `IDR`
localestring"en"the language of the money, for example `id`
discountnumber—the money off, as a positive amount
discountLabelstring—the name of the discount, for example the code
shippingnumber—the cost of shipping; 0 shows "Free", and none hides the row
taxnumber—
labelsPartial<{ title: string; subtotal: string; discount: string; shipping: string; free: string; tax: string; total: string; quantity: (n: number) => string; }>—

Slots

NameScopeDescription
footer{ total: number; }

Released under the MIT License. Character names and artwork belong to their owners.