AmountInput
The AmountInput is a number input designed to handle currency amounts.
View source code- currency
AmountInputCurrency
The currency to display.
- onChange
(event: ChangeEvent<HTMLInputElement>, newValue: number) => void
Handler that is called when the value changes.
- value
number
The current value (controlled).
- className
string
className for the element.
- currencies
AmountInputCurrency[]
The list of currencies to display in the dropdown.
- fit
"content" | "parent"
Whether the AmountInput should fit its parent or content.
Default: content - hasNegativeValueAllowed
boolean
Whether the AmountInput allows negative values.
- id
string
The id of the AmountInput.
- isDisabled
boolean
Whether the AmountInput is disabled.
- isInvalid
boolean
Whether the AmountInput is invalid.
- leftAddon
ReactNode
Left addon of the input.
- name
string
The name of the AmountInput, used when submitting an HTML form.
- onBlur
FocusEventHandler<HTMLInputElement>
Handler that is called when the element loses focus.
- onFocus
FocusEventHandler<HTMLInputElement>
Handler that is called when the element receives focus.
- onKeyDown
KeyboardEventHandler<HTMLInputElement>
Handler that is called when a key is pressed.
- onSelectCurrency
(selectedCurrency: AmountInputCurrency, newValue: number) => void
Handler that is called when a currency is selected.
- placeholder
string
Temporary text that occupies the AmountInput when it is empty.
- variant
"default" | "magicGradient"
The visual style of the AmountInput.
Default: default