Currency Input
Money entry with the currency symbol before the value, two decimals, and an optional currency picker.
€20,000.00 available
€4,540.00 available
€20,000.00 available
€20,000.00 available
10000
You might be looking for:
- Input
Single-line text entry.
- Textarea
Multi-line text entry.
- Number Input
Numbers only: shares, units, counts.
- Date Picker
Pick a calendar date from a popover.
CurrencyInput is the money row. It always lives inside a Field, which carries the label, card, focus ring, help and errors. For shares, units and counts use Number Input.
- Only digits and one decimal mark get in, with thousands separators as you
type. Two decimals at most, padded (
3,250.4to3,250.40) once the user leaves the field. - The prefix is the symbol for
currency: € for EUR (the default), $ for USD, £ for GBP, else the code. - One trailing control at most: the picker, else
children(a Max chip), else the clear affordance fromonClear.
Usage
import { CurrencyInput } from "@sophic/portal-ui/components/ui/currency-input";
import {
Field,
FieldDescription,
FieldLabel,
} from "@sophic/portal-ui/components/ui/field";
<Field size="lg">
<FieldLabel htmlFor="amount">Amount to invest</FieldLabel>
<CurrencyInput
id="amount"
value={amount}
valueIsNumericString
onValueChange={(next) => setAmount(next.value)}
onClear={() => setAmount("")}
/>
<FieldDescription>€20,000.00 available</FieldDescription>
</Field>;Store next.value (dot-decimal, no separators, e.g. "1234.5") and pass
it back with valueIsNumericString. next.floatValue is the number for
quote math. Help goes under the card by default, or on the label row with
<FieldDescription placement="label">.
Currency picker
picker puts a CurrencySelect (flag, code and name) in the row as its one
trailing control. currencies defaults to DEFAULT_CURRENCIES (EUR, USD,
GBP); currency and onCurrencyChange hold the choice, and the prefix
follows it.
<Field>
<FieldLabel htmlFor="send">Amount to send</FieldLabel>
<CurrencyInput
id="send"
value={amount}
valueIsNumericString
onValueChange={(next) => setAmount(next.value)}
picker
currency={currency}
onCurrencyChange={setCurrency}
/>
</Field>Examples
Limit price
Two money rows in one field, with a divider between the sections.
€4,540 available
Validation error
The error ring and halo come from the wrapping Field. The footer pairs
the message with a recovery action.
Dual amount
DualAmountControl pairs a cash end (CurrencyInput) with a shares or units
end (NumberInput) when the user can size in cash or shares: hero switcher
(one field plus a pill) or connected (both fields, mid swap). The pill names
the other mode: Buy in shares / Buy in cash. rate is always
cash to units (e.g. 1 / price); the last-edited side is the source.
cashCurrency (default EUR) sets the cash end's symbol.
import { DualAmountControl } from "@sophic/portal-ui";
<DualAmountControl
layout="hero-mode-switch"
rate={1 / 703.4}
cashLabel="Amount to invest"
modeSwitchVerb="Buy"
onChange={({ amount, sizeMode }) => {
setAmount(amount);
setSizeMode(sizeMode);
}}
/>;Props
Prop
Type
Default
Prop
Type
Default
Changelog
- 8 October 2026: added; replaces Amount Field / Currency Field. Full notes
- 26 September 2026 — Removed the limit-versus-market chip. Full notes
- 15 August 2026 — Hero switcher pill says Buy in shares / Buy in cash. Full notes
- 14 August 2026 — Added Amount Field and DualAmountControl. Full notes
- 26 September 2026 — Removed the limit-versus-market chip. Full notes
- 15 August 2026 — Hero switcher pill says Buy in shares / Buy in cash. Full notes
- 14 August 2026 — Added Amount Field and DualAmountControl. Full notes