Currency Input
Installation
yarn add @spark-web/currency-input
Currency input provides a way for inputting money values. Note that this
component is similar to the FloatInput
component with
the difference that this component has 2 fraction digits enforced and a currency
symbol starting adornment.
Examples
Currency Symbol Adornment
You can specify what currency type you'd like for the currency symbol adornment at the start of the input component. If unspecified, the currency symbol adornment will default to AUD. Note that the currency codes are references to the respective currency's ISO 4217 currency codes.
Prop | Type | Description |
---|---|---|
children? | AdornmentsAsChildren: ReactElement<InputAdornmentProps, string | JSXElementConstructor<any>> | [ReactElement<InputAdornmentProps, string | JSXElementConstructor<any>>, ReactElement<InputAdornmentProps, string | JSXElementConstructor<...>>] | Adorn the input with ornamental element(s) to aid user input, or interactive element(s) to augment user input. Each child **must** be wrapped with the `InputAdornment` component to ensure proper layout, otherwise it will not be rendered. |
currencyType? | "BOV" | "CHE" | "CHF" | "CHW" | "CLF" | "COU" | "MAD" | "MXV" | "UYI" | "UYW" | "XUA" | "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | ... 162 more ... | "ZWL" | Specifies what currency symbol you want as a starting adornment to the component. |
data? | DataAttributeMap | Sets data attributes on the component. Sets data attributes for the element. |
onChange? | (value: string | number) => void | |
value? | string | number |
Note that CurrencyInput
also extends FloatInput
's
props and are not listed here.