0.1.3 • Published 1 year ago

react-separator-input v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-separator-input

A number input component with automatically added separators.

NPM version

Feature

  1. Configurable thousand and decimal separator
  2. Support number precision
  3. 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} />);