SeatsCalculator
Pick how many seats. The total rolls digit by digit, a discount slides in when a tier unlocks and a nudge says how many more seats earn the next. Pricing.
Open playgroundSeats
$12 per seat/mo
8 × $12$96
$96/mo
Add 2 more to save 10%
About
SeatsCalculator 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 { SeatsCalculator } from "@ashutoshswamy/smoui" and set perSeat, min, tiers among its 4 props.
Install
npm i @ashutoshswamy/smouiUsage
import { SeatsCalculator } from "@ashutoshswamy/smoui";
<SeatsCalculator perSeat={12} defaultSeats={8} tiers={[{ from: 10, off: 10 }, { from: 25, off: 20 }]} onChange={(seats, total) => quote(seats, total)} />Props 4
- perSeat
Price of one seat per period.
number- min / max / defaultSeats
Seat limits and start.
numberdefault1 / 500 / 5- tiers
Volume discounts, lowest first. `off` is a percent.
{ from; off }[]- currency / period
Price affixes.
stringdefault"$" / "/mo"
More pricing components
- BillingToggleMonthly/yearly switch. The thumb stretches to the choice and a savings badge pops in on yearly.
- OrderSummaryA checkout total. Type a promo code and a discount line slides in while the total rolls down; a wrong code shakes the field.
- 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.