InputMoney

v9.3.0 Edit this page
Loading...

Usage

Loading examples...

Props

<InputMoney>

Standard currency / money wrapper composing the standard NerdWallet formatted input component. There are some props that we don't allow the consumers to override (like type) on the underlying Formatted (and thus Input) component. See FormattedInput for the base formatted input component, as well as reference to the underlying react-number-format lib. react-number-format provides numerous props to override the formatted input if desired (like format and mask). InputMoney has an opinionated design, and some of those props are not surfaced in InputMoney.propTypes.

Name

Description

Type

Default

allowNegative

Flag to enable the user to be able to supply a '-' to indicate the value should be negative.

bool

false

label

The default label associated with the input field. Should always be supplied to meet accessibility best practices.

string

'Money'

placeholder

String to override the default placeholder text, which is "$".

string

'$'

value

In general all input components should be controlled, which means their value is passed into the component, and state is maintained within the React component as opposed to using refs from the DOM. Although generally required, default to ''.

string

or

number

See Also