InputPercent

Storybook
GitHub
Loading...

Usage

import InputPercent from '@nerdwallet/react-formatted-input/input-percent';
<InputPercent />

Loading examples...

<InputPercent>

allowNegative

boolean

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

Default

false

label

string

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

Default

'Percent'

numberOfDigits

string | number

Enables ability to limit the number of digits the input allows in total. Defaults to 2.

Default

2

placeholder

string

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

Default

'%'

value

string | number

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 ''.

Default

''

See Also