Founding price: $35, then $99 after 23:59 UTC on 4 November, then $99
Get ProAn amount field joined to a currency picker: it parses what people type in either decimal style, formats to the currency's minor units on blur, and reports the value as integer minor units with the currency code. Use this when people enter a price, a budget or a payment.
Derived from this item’s props table, because it declares no controls of its own. This item has no standalone playground, so changes update the code, the share link and the AI prompt.
Use it for prices, invoices and budgets, where "1.234,50" and "1,234.50" both appear, yen has no decimals, and the application needs 123450 and "EUR", not a string.
Do not use it when the currency is fixed. Use a plain formatted number input.
This item is part of tealmac UI Pro
The source for this item installs with a Pro licence key. Log in with your key to see the install command, or read the Pro setup page.
| Prop | Type | Default | Description |
| --------------- | --------------------- | ---------------------------------- | ---------------------------------------------------- | --------------------------------------- |
| currencies | string[] | USD, EUR, GBP, JPY, KWD, INR | ISO 4217 codes offered. |
| value | { minor: number \\ | null; currency: string } | - | The amount in minor units (controlled). |
| defaultValue | { minor, currency } | { minor: null, currency: first } | Initial value. |
| onValueChange | (value) => void | - | Runs when the parsed amount or the currency changes. |
| locale | string | browser | Locale for display formatting. |
| label | string | Amount | Names the group and the number field. |
role="group" and the label; the number field is inputmode="decimal" with aria-label <label> amount; the currency button is labelled Currency, USD.parseAmount accepts both 1,234.50 and 1.234,50 by treating the last separator as the decimal mark when it is followed by one or two (or the currency's number of) digits.aria-invalid.JPY has none).The pattern ships with a Testing Library test (currency-amount-input-with-picker.test.tsx) that covers parsing both decimal styles, minor units per currency, formatting on blur and keeping the number across currencies.