OrderSummary

A checkout total. Type a promo code and a discount line slides in while the total rolls down; a wrong code shakes the field. Pricing.

Open playground
Order summary
Pro plan, yearly$190
Extra seats × 3$108
Tax (8%)$23.84
Total$321.84

Try SPRING20

About

OrderSummary is a React component in the Pricing category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { OrderSummary } from "@ashutoshswamy/smoui" and set items, codes, taxRate.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { OrderSummary } from "@ashutoshswamy/smoui";

<OrderSummary taxRate={8} codes={{ SPRING20: 20 }} items={[{ label: "Pro plan", price: 190 }]} cta="Pay now" />

Props 3

items

Line items in whole units.

{ label; price }[]
codes

Promo codes and the percent each takes off.

Record<string, number>
taxRate / currency / cta

Tax percent and labels.

number / string / stringdefault 0 / "$" / "Pay now"