ValyroUI Русская версия

Subscription Plan Simulator

Pricing calculator: seats, monthly or yearly, VAT and an exact price breakdown. Pro · Shop and payments › Subscriptions and plans

A pricing calculator: seats and billing period in, an exact quote per plan out — line items for flat, per-seat and tiered pricing, the yearly discount, VAT (added or included) and the yearly saving. Amounts are computed in integer minor units and formatted for the locale.

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add subscription-plan-simulator
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { SubscriptionPlanSimulator } from 'valyro-ui-pro';

Props

PropTypeDefault
plans *SubscriptionPlan[]Plans with their pricing model: flat, per seat, graduated or volume tiers.
seatsnumberNumber of seats to price.
defaultSeatsnumber5Initial seats when uncontrolled. Default 5.
onSeatsChange(seats: number) => voidCalled when the reader changes the seat count.
period'month' | 'year'Billing period.
defaultPeriod'month' | 'year''month'Initial period when uncontrolled. Default month.
onPeriodChange(period: BillingPeriod) => voidCalled when the reader switches monthly / yearly.
currency *stringISO 4217 code of every price. Minor units follow the currency (2 for USD, 0 for JPY).
taxMode'exclusive' | 'inclusive' | 'none''exclusive'exclusive (default) adds tax on top; inclusive shows the tax inside the price; none hides it.
taxRatenumber0Tax rate as a fraction, e.g. 0.2 for 20% VAT. Default 0.
seatRange[min: number, max: number][1, 100]Range of the seat slider. Default 1–100.
onSelect(plan: SubscriptionPlan, quote: Quote) => voidCalled by a plan's button with the plan and its exact quote.
loadingbooleanfalsePlans are loading: skeleton cards.
errorReactNodeLoading failed: shown instead of the plans.
titleReactNodeHeading. Default: labels.title.
headingLevel2 | 3 | 4 | 53Level of the heading (default 3); plan names take the next level.
localestringBCP 47 locale for prices; defaults to the ThemeProvider's.
labelsPartial<SubscriptionPlanSimulatorLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Usage Quota · Next: Article Header · All Shop and payments