2.0.0 • Published 5 years ago

react-formatted-number-input v2.0.0

Weekly downloads
31
License
MIT
Repository
github
Last release
5 years ago

React formatted number input

A higher order component for formatting values in input elements as numbers

Build Status Code Coverage NPM version

Install

$ npm install --save react-formatted-number-input

Usage

import React from 'react';
import { createFormattedNumberInput } from 'react-formatted-number-input';

const FancyInput = React.forwardRef((props, ref) => {
  return <div><input ref={ref} {...props} /></div>;
});

const FormattedNumberInput = createFormattedNumberInput(FancyInput, { precision: 2 });

const Demo = () => {
  const [value, setValue] = React.useState();

  return <FormattedNumberInput value={value} onChange={setValue} />;
}

License

MIT © Jonathan Svenheden

2.0.0

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago