Description
react-currency-input is an ES2015 React component for entering currency amounts. It supports custom decimal and thousand separators as well as a set precision, so values can follow different number formats. The value prop sets the initial amount and defaults to 0. The onChangeEvent callback receives changes, and it replaces the older onChange option, which the README marks as deprecated because onChangeEvent matches React's default input handling for argument order. The README covers two ways to read the value. You can store the value passed to the change handler in your state, or assign a ref and read the value with getMaskedValue. Options include precision, which defaults to 2, the decimal and thousand separators, an inputType of text, number or tel, allowNegative, allowEmpty and selectAllOnFocus. You can set a currency symbol as a prefix or suffix, and negative signs come before the prefix. Other attributes are applied to the input element, so you can add Bootstrap styling. The version 1.3.0 notes say the library moved to React 15, added a parseFloat polyfill and fixed an issue with event pooling. It suits React developers who need a formatted currency field in a form.…
Highlights
- Currency input for React
- Custom decimal and thousand separators
- Set precision and currency symbol
- Read values with getMaskedValue
- Other attributes passed to the input
Ratings & Reviews
No ratings yet
Be the first to rate react-currency-input.
People also visit

react-native-currency-input
A simple currency input component for both iOS and Android
react-currency-input FAQ
What is react-currency-input?
An ES2015 React component for entering currency amounts, with custom separators and precision.
How do I read the value?
Store the value from the change handler in state, or assign a ref and call getMaskedValue().
What replaced onChange?
onChangeEvent. The README marks onChange as deprecated.
Can I add a currency symbol?
Yes. Set it as a prefix or suffix. Negative signs come before the prefix.
Can I use Bootstrap styling?
Yes. The README says other attributes go to the input element, so Bootstrap classes work.
What are the best react-currency-input alternatives?
Popular alternatives to react-currency-input include react-currency-format, react-number-format and react-native-currency-input. See all react-currency-input alternatives


















