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 playgroundOrder 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
npm i @ashutoshswamy/smouiUsage
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 / stringdefault0 / "$" / "Pay now"
More pricing components
- BillingToggleMonthly/yearly switch. The thumb stretches to the choice and a savings badge pops in on yearly.
- PlanCompareFeature comparison. One column highlight stretches to the column you point at; rows and ticks cascade in.
- PlanPickerPlans as a radio list. One tinted block glides to the chosen plan, the radio fills with a pop and arrow keys move the choice.
- PricingCardOne plan card. Price rolls with billing, features tick in on scroll, the featured card sits on grainy mesh.
- PricingSliderUsage-based pricing. Drag the jelly thumb through tiers; the label rides its bubble and the price rolls.
- PricingTablePlans with a monthly/yearly switch. Prices roll to their new value; one highlight stretches between plans.