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.
- Host: GitHub
- URL: https://github.com/kessejones/react-custom-number
- Owner: kessejones
- Created: 2021-01-13T00:47:27.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-19T11:05:12.000Z (over 4 years ago)
- Last Synced: 2024-04-24T19:32:35.180Z (about 1 year ago)
- Topics: front-end, react, reactjs, typescript, web
- Language: TypeScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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