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
linesis a list of lines. Each line has anid, aname, thepriceof one, and aquantity. It can also have anote, such as the size, and animage. The line shows the price times the quantity.- Under the lines, the summary shows the subtotal, the
discountwith itsdiscount-label, theshipping, thetax, and the total. Ashippingof 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.
currencyis an ISO code (defaultUSD), andlocalesets the format of the money (defaulten).- The
footerslot holds your button. It gets{ total }. - The summary is a region named by its title. Change the words with
labelsor a label pack:title,subtotal,discount,shipping,free,tax,total, andquantity(a function of the count).
Usage
ts
import { BlessOrderSummary } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
lines* | BlessOrderLine[] | — | |
currency | string | "USD" | an ISO code, for example `IDR` |
locale | string | "en" | the language of the money, for example `id` |
discount | number | — | the money off, as a positive amount |
discountLabel | string | — | the name of the discount, for example the code |
shipping | number | — | the cost of shipping; 0 shows "Free", and none hides the row |
tax | number | — | |
labels | Partial<{ title: string; subtotal: string; discount: string; shipping: string; free: string; tax: string; total: string; quantity: (n: number) => string; }> | — |
Slots
| Name | Scope | Description |
|---|---|---|
footer | { total: number; } |