v2.0.6

Currency Input

Installation

Install yarn add @spark-web/currency-input
Source GitHub.com
Bundle unpkg.com

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

$
The current value is: 1000

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.

PropTypeDescription

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.

© 2023 Brighte Capital Pty Ltd