Prodular UI

Inputs

Amount inputPro

A money field that takes its decimals and symbol from the currency and its grouping from the locale, with an optional currency switch.

npx prodular-ui add amount-input

Part of Prodular UI Pro. Preview and read the docs freely, install with a license. See pricing

Payment against an invoice

The value is a number in major units. formatAmount prints totals the same way the field does.

$

$5,900.00 left on INV-2087 for Northwind Logistics.

Currencies and locales

PLN puts the symbol after the number, JPY has no decimals, EUR in de-DE uses a comma for decimals.

zล‚

Payments above 48ย 250,50ย zล‚ need a second approver. Switch to JPY and the decimals go.

Anatomy

<Field>  <FieldLabel>Payment received</FieldLabel>  <AmountInput currency="USD" locale="en-US" value={amount} onValueChange={setAmount} /></Field>

Guidance

Use it when

  • Prices, limits, payments, budgets: any amount of money people type.
  • currencies when the same form handles several, with onCurrencyChange to switch.

Avoid

  • Percentages or counts. Use Number input with a unit.
  • Hardcoding the symbol in a prefix. The currency and locale decide it.

Rules for AI agents

Published in llms-full.txt and the registry, so coding agents follow them when they build with this component.

  • Always pass currency as an ISO 4217 code and the user's locale. Never hardcode $ or decimals.
  • Keep the value in major units (12.50, not 1250). Convert to minor units only at the API boundary.
  • Show totals and summaries with formatAmount(value, currency, locale) so they match the field.
  • Label it with Field and FieldLabel, and put limits in min and max.

API

AmountInput

PropTypeDefaultDescription
currencystringISO 4217 code. Sets decimals and symbol.
localestringGrouping, decimal mark and the side the symbol sits on.
currencies / onCurrencyChangestring[] / (code) => voidShows a currency switch at the end of the field.
display"symbol" | "code""symbol"Show USD instead of $ where the symbol is ambiguous.
value / onValueChange / min / maxnumber | nullSame as Number input, in major units.

formatAmount

PropTypeDefaultDescription
(value, currency, locale)stringFormats an amount the way the field shows it.