@beroburny/react-number-input
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-11 • Public • Published

React Number Input

Best component library to provide great developer and user experience for number inputs.

Still in development

npm peer dependency version npm npm David Build Status codecov Known Vulnerabilities GitHub license

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

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i @beroburny/react-number-input

    Weekly Downloads

    1

    Version

    0.0.1-11

    License

    MIT

    Unpacked Size

    75.2 kB

    Total Files

    96

    Last publish

    Collaborators

    • beroburny