@la-components/react-numerical-input

1.0.1 • Public • Published

NUMERICAL INPUT

Demo

Numerical Input Demo

Supported formats

[
    "integer": ["all", "positive"]
    "decimal": ["all", "positive", "limited decimal places"]
]

Basic Usage

import React from 'react';
import {Numeric} from '../src/components/numeric';

export class Form extends React.Component {
    constructor(props){
        super(props);        

        this.state = {
            input: -0.123
        }
        this.handleInputChange = this.handleInputChange.bind(this);
    }   

    handleInputChange(data){
        this.setState({input: data.value});
    }

    render() {        
        return (
            <form >
                <Numeric    className={"greenBorder"}
                            format={"decimal"} 
                            positive={true}  
                            decimalPlaces={4} 
                            value={this.state.input} 
                            onChange={this.handleInputChange}/>
            </form>
        );
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @la-components/react-numerical-input

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

129 kB

Total Files

8

Last publish

Collaborators

  • dungkos
  • walternguyen
  • parsonsnguyen
  • happy.duong