react-separator-input
v0.1.3
Published
React input component and HOC with automatically added separator.
Downloads
1
Maintainers
Readme
react-separator-input
A number input component with automatically added separators.
Feature
- Configurable thousand and decimal separator
- Support number precision
- HOC to support use with UI framework like antd and materialUI
Install
npm install react-separator-input --save
Docs
https://qinyunwang.github.io/react-separator-input/
Usage
HTML input component
import { SeparatorInput } from 'react-separator-input';
React.render(<SeparatorInput thousandSeparator="," precision={2} />);
With UI libraries
import { withSeparator } from 'react-separator-input';
import { Input } from 'antd';
const AntdInput = withSeparator(Input);
React.render(<AntdInput thousandSeparator="," precision={2} />);