The AmountInput is a number input designed to handle currency amounts.
View source codeAmountInputCurrency
The currency to display.
(event: ChangeEvent<HTMLInputElement>, newValue: number) => void
Handler that is called when the value changes. When reading the new value, it is recommended to use the 'newValue' parameter rather than event.target.valueAsNumber to ensure the value is correctly formatted.
number
The current value (controlled).
string
className for the element.
AmountInputCurrency[]
The list of currencies to display in the dropdown.
"content" | "parent"
Whether the AmountInput should fit its parent or content.
Default: contentboolean
Whether the AmountInput allows negative values.
string
The id of the AmountInput.
boolean
Whether the AmountInput is disabled.
boolean
Whether the AmountInput is invalid.
ReactNode
Left addon of the input.
string
The name of the AmountInput, used when submitting an HTML form.
FocusEventHandler<HTMLInputElement>
Handler that is called when the element loses focus.
FocusEventHandler<HTMLInputElement>
Handler that is called when the element receives focus.
KeyboardEventHandler<HTMLInputElement>
Handler that is called when a key is pressed.
ClipboardEventHandler<HTMLInputElement>
Handler called when clipboard content is pasted into the amount field.
(selectedCurrency: AmountInputCurrency, newValue: number) => void
Handler that is called when a currency is selected.
string
Temporary text that occupies the AmountInput when it is empty.
"default" | "magicGradient"
The visual style of the AmountInput.
Default: default