Currency Input
Type an amount; store a number. Thousand separators update while you type. Pass any ISO currency + locale — Intl supplies the symbol and separators. The amount stays LTR for caret stability; the addon follows start/end.
Gallery
Price card with a live numeric readout. value / onValueChange stay numbers.
Loading…
Installation
CLI
Also needs
npx @sonojs/ui@latest add input-groupUsage
currency-input.tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number · null | - | Controlled numeric amount. |
| defaultValue | number · null | null | Initial amount when uncontrolled. |
| onValueChange | (value: number · null) => void | - | Fires with the parsed number (or `null` when empty). |
| currency | string | "USD" | ISO 4217 code passed to `Intl.NumberFormat`. |
| locale | string | "en-US" | BCP 47 locale for separators and symbol side. |
| currencyDisplay | "symbol" · "narrowSymbol" · "code" · "name" | "symbol" | How the addon label is rendered. |
| minimumFractionDigits | number | from currency | Blur formatting floor for fraction digits. |
| maximumFractionDigits | number | from currency | Typing and blur fraction digit cap. |
| min | number | - | Lower clamp on commit. |
| max | number | - | Upper clamp on commit. |
| showCurrencyAddon | boolean | true | Show the currency symbol/code addon. |
| disabled | boolean | false | Disables the field. |
| className | string | - | Merged onto the `InputGroup` root. |
Related
- Input Group, addon chrome used for the currency label
- Input, plain text field without money formatting
- Field, label and describe the control