TotalsBlock
Subtotal + discount controls + total — the panel footer recap.
Composes SummaryRow ×3 with an optional DiscountController in the middle. Caller passes pre-formatted strings for subtotal/total/discount amount and an `onChange` for the discount state.
Install
Pull from the workspace packages (already available if you ran pnpm add):
Examples
With discount controller
Subtotal
$1,200.00
Discount
—
%
$
0%
5%
10%
15%
20%
−$180.00
Total
$1,020.00
Simple (no discount)
Subtotal
$1,200.00
Total
$1,200.00
Guidelines
✓
Pass `discount.amount` as a string that already includes the leading minus sign.The recipe doesn't format money — that's app policy.
✕
Use it when you have multiple discount stacks (tax, shipping, promo).TotalsBlock is one-discount opinionated. Hand-compose SummaryRows for richer layouts.