{"id":21659064,"url":"https://github.com/himelbrand/react-native-numeric-input","last_synced_at":"2025-07-17T21:32:19.527Z","repository":{"id":30819431,"uuid":"125231276","full_name":"himelbrand/react-native-numeric-input","owner":"himelbrand","description":"a stylish numeric input for react native","archived":false,"fork":false,"pushed_at":"2023-12-04T19:21:58.000Z","size":40733,"stargazers_count":149,"open_issues_count":45,"forks_count":89,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-25T04:42:47.657Z","etag":null,"topics":["component-library","numeric-input","react-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/himelbrand.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-14T15:08:08.000Z","updated_at":"2024-06-18T15:15:08.505Z","dependencies_parsed_at":"2024-06-18T15:15:07.160Z","dependency_job_id":"0478574c-5e60-4bc0-96b8-62fe0637affb","html_url":"https://github.com/himelbrand/react-native-numeric-input","commit_stats":{"total_commits":96,"total_committers":11,"mean_commits":8.727272727272727,"dds":"0.48958333333333337","last_synced_commit":"c7fca991858517f2333b736cb700a1394e29c929"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himelbrand%2Freact-native-numeric-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himelbrand%2Freact-native-numeric-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himelbrand%2Freact-native-numeric-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himelbrand%2Freact-native-numeric-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/himelbrand","download_url":"https://codeload.github.com/himelbrand/react-native-numeric-input/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226305140,"owners_count":17603748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component-library","numeric-input","react-native"],"created_at":"2024-11-25T09:30:22.546Z","updated_at":"2024-11-25T09:30:39.264Z","avatar_url":"https://github.com/himelbrand.png","language":"JavaScript","readme":"# react-native-numeric-input\na cross platform stylish numeric input for react native\n\n\u003ch3 align=\"center\"\u003e\u003cb\u003eVisual Demo\u003c/b\u003e\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://media.giphy.com/media/4To90hOE71mUTgdBVZ/giphy.gif\"/\u003e\n\u003c/p\u003e\n\n## Working example\nyou can check out the very simple react native example app\njust click [here](https://github.com/himelbrand/react-native-numeric-input/tree/master/Example) and follow the instructions\nenjoy!\n\n## Installation\n### Latest version\nv1.9.0\n#### if you have react-native-vector-icons installed in your project\n```bash\nyarn add react-native-numeric-input\n```\nor with npm\n```bash\nnpm install react-native-numeric-input --save\n```\n#### if you don't have react-native-vector-icons installed in your project\n```bash\nyarn add react-native-numeric-input react-native-vector-icons\nreact-native link\n```\n\nor with npm\n\n```bash\nnpm install react-native-numeric-input react-native-vector-icons --save\nreact-native link\n```\nif you're experiencing issues with `react-native link` which is used to install react-native-vector-icons\nplease refer to [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons) to see manual installation steps\n\n[link to npm page](https://www.npmjs.com/package/react-native-numeric-input)\n\n## Responsive default size\n\nthis component uses the [react-native-pixel-perfect](https://www.npmjs.com/package/react-native-pixel-perfect)\n\nand the defualt style is using base resolution for iphone7, in case you want to use the default design but, using a different base resolution, I added a function called updateBaseResolution(width,height) to use it you need to access it via a ref to the component.\n\nsince the component is dependant on react-native-pixel-perfect, when installing this package you install also react-native-pixel-perfect if it's not already installed.\n\nso you can create your own responsive size function and use it to set your custom style.\n\n## Usage\n\n### import Component\n```javascript\nimport NumericInput from 'react-native-numeric-input'\n```\n### Basic Usage\n```javascript\n\u003cNumericInput onChange={value =\u003e console.log(value)} /\u003e\n```\n\n**or basic up-down**\n\n```javascript\n\u003cNumericInput type='up-down' onChange={value =\u003e console.log(value)} /\u003e\n```\n### Keep State Value\n```javascript\n\u003cNumericInput value={this.state.value} onChange={value =\u003e this.setState({value})} /\u003e\n```\n### Advanced Usage\n```javascript\n        \u003cNumericInput \n            value={this.state.value} \n            onChange={value =\u003e this.setState({value})} \n            onLimitReached={(isMax,msg) =\u003e console.log(isMax,msg)}\n            totalWidth={240} \n            totalHeight={50} \n            iconSize={25}\n            step={1.5}\n            valueType='real'\n            rounded \n            textColor='#B0228C' \n            iconStyle={{ color: 'white' }} \n            rightButtonBackgroundColor='#EA3788' \n            leftButtonBackgroundColor='#E56B70'/\u003e\n```\n\n\n## Props\nName                                | Type                                | Default\n------------------------------------|-------------------------------------|:-------:\n**value**                           |`number`                             | none\n**minValue**                        |`number`                             | none\n**maxValue**                        |`number`                             | none\n**step**                            |`number`                             | 1\n**valueType**                       |`'integer'` or `'real'`                  | `'integer'`\n**initValue**                       |`number`                             | null if not used will start at 0\n**iconSize**                        |`number`                             | calcSize(30)\n**borderColor**                     |`string`                             | `'#d4d4d4'`\n**iconStyle**                       |`object`                             | none\n**totalWidth**                      |`number`                             | calcSize(220)\n**separatorWidth**                   |`number`                             | 1\n**type**                            |`'plus-minus'` or `'up-down'`        | `'plus-minus'`\n**rounded**                         |`boolean`                            | false\n**textColor**                       |`string`                             | `'black'`\n**containerStyle**                  |`object`                             | none\n**inputStyle**                      |`object`                             | none\n**upDownButtonsBackgroundColor**    |`string`                             | `'white'`\n**rightButtonBackgroundColor**      |`string`                             | `'white'`\n**leftButtonBackgroundColor**       |`string`                             | `'white'`\n**totalHeight**                     |`number`                             | none\n**onChange**                        |`function`                           | none - required prop\n**onLimitReached**                  |`function`                           | none (empty function)\n**editable**                        |`boolean`                            | true\n**validateOnBlur**                  |`boolean`                            | true\n**reachMaxIncIconStyle**            |`object`                             | none\n**reachMaxDecIconStyle**            |`object`                             | none\n**reachMinIncIconStyle**            |`object`                             | none\n**reachMinDecIconStyle**            |`object`                             | none\n**extraTextInputProps**             |`object`                             | none\n\n### notes about props\n\n* **value prop** - this component uses it's own state to hold value if value is not given as a prop\n* **style props** - this component has a default style and the styles props are to override the default style or add more fields\n* **totalWidth prop** - this prop is for the entire component width, and all other sizes are derived from it , unless given other size props\n* **initValue prop** - if using value prop, this is not needed and the initial value can be given by the value prop\n* **validateOnBlur** - added on version 1.3.2, if set to false the text input will validate while typing, not recommended, so just keep it true unless there is a good reason not to use the default functionallity \n* **reachMaxIncIconStyle** - added on version 1.4.0, used to set style to the increment button icon in case maxValue is reached - **optional**\n* **reachMaxDecIconStyle** - added on version 1.4.0, used to set style to the decrement button icon in case maxValue is reached - **optional**\n* **reachMinIncIconStyle** - added on version 1.4.0, used to set style to the increment button icon in case minValue is reached - **optional**\n* **reachMinDecIconStyle** - added on version 1.4.0, used to set style to the decrement button icon in case minValue is reached - **optional**\n* **onLimitReached** - added on version 1.7.0, used to handle event of min/max reached, **this function receives 2 arguments: (isMas:Boolean, msg:String)** like in the advanced example above - **optional**\n* **extraTextInputProps**  - added on version 1.8.0, used to add props used for the original TextInput component that are not used/supported in this component explicitly - **optional**\n\n\n## Versioning\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/himelbrand/react-native-numeric-input/tags). \n\n## License\nThis project is licensed under the MIT License\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimelbrand%2Freact-native-numeric-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhimelbrand%2Freact-native-numeric-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimelbrand%2Freact-native-numeric-input/lists"}