An open API service indexing awesome lists of open source software.

https://github.com/kessejones/react-custom-number

A simple input component with custom properties like places, prefix, suffix and more.
https://github.com/kessejones/react-custom-number

front-end react reactjs typescript web

Last synced: 2 months ago
JSON representation

A simple input component with custom properties like places, prefix, suffix and more.

Awesome Lists containing this project

README

        

# React Custom Number

## Install

`$ npm install react-custom-number`
or
`$ yarn add react-custom-number`

## Examples

```js
import React, { useState } from 'react';
import CustomNumber from 'react-custom-number';

export default function App(){
const [ value, setValue ] = useState('0');

function onTextChange(v) {
setValue(v);
}

return (




);
}

```

```js
import React, { useState } from 'react';
import CustomNumber from 'react-custom-number';

export default function App(){
const [ value, setValue ] = useState('0');

function onTextChange(v) {
setValue(v);
}

return (




);
}

```

## Properties

In addition to having all the properties of an HTML input, CustomNumber has the following properties:

Name | Type | Default Value
--------------------|-----------|---------------
prefix | String | ""
suffix | String | ""
places | Number | 2
decimalSeparator | String | "."
thousandsSeparator | String | ","
thousandsGroup | Number | 3
onTextChange | Function | null