React Number Input
Best component library to provide great developer and user experience for number inputs.
Still in development
Installation
with npm
npm i @beroburny/react-number-input
with yarn
yarn add @beroburny/react-number-input
Component's
FormattedNumberInput
(alias CurrencyInput
)
Provide formatted values to provide better visual representation of imputed number.
(format number 10000000.3 to be like 10,000,000.30)
Props
Props | Required | Type |
---|---|---|
value | ✓ | number |
separatorType | 'eu' or 'us' | |
minimumFractionDigits | number | |
maximumFractionDigits | number | |
onChange | (value: number) => void |
and standard props from input field
Basic usage
import React from 'react';
import ReactDOM from 'react-dom';
import {CurrencyInput} from '@beroburny/react-number-input';
const App = () => {
const [value, setValue] = React.useState(0);
return (<CurrencyInput value={value} onChange={setValue} />);
};
ReactDOM.render(<App />, document.getElementById('root'));
Changelog (latest)
- improve handling '0' at first place
- small bug fixes
- fix package vulnerabilities
entire changelog