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 playground
Seats
$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

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
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.

numberdefault 1 / 500 / 5
tiers

Volume discounts, lowest first. `off` is a percent.

{ from; off }[]
currency / period

Price affixes.

stringdefault "$" / "/mo"