Components/Installments Selector
Installments Selector
Parcelamento picker: renders "3x de R$ 33,33 sem juros" options from a total in integer cents, with optional Price-table interest beyond the interest-free tier.
Pick an option - the callback receives count, per-installment and total amounts in cents.
Installation
npx @ajax-ui/cli add installments-selectorProps
totalCents- purchase total in minor units (required).maxInstallments(default12) - highest count offered.interestFreeUpTo- options up to this count are "sem juros"; default all.monthlyInterest- monthly rate as a ratio (0.0199= 1,99% a.m.), applied via Price table beyond the interest-free tier.minInstallmentCents- hides options whose installment falls below this floor.value/defaultValue/onValueChange(option)- the option carriescount,installmentCents,totalCents,interestFree.currency/locale- forwarded to the shared formatters (default BRL / pt-BR).- Helper exported alongside:
buildInstallmentOptions(args)for rendering your own UI.
Interest math
Interest-bearing options use the Price table (French amortization), the Brazilian market standard: pmt = PV × i / (1 − (1 + i)⁻ⁿ), rounded to the cent per installment. Interest-free options split the principal and round per installment for display - exact penny allocation across installments is your billing system's concern, not the UI's.
Accessibility
- Renders a styled native
<select>- full keyboard support and the OS picker on mobile, no custom listbox to maintain. - Label each instance with
aria-labelor a paired<label>.