Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
rn-number-input
Advanced tools
Created as an alternative to the native Picker component, rn-number-input is the number equivalent of <TextInput />
and behaves and looks very similar to what you see on the web <input type='number' />
.
Screenshot of <NumberInput />
rn-number-input requires react-native 0.20 or later.
npm install --save rn-number-input
To build the example locally, clone this repo then run:
cd example
npm install
react-native (run-ios|run-android)
import React from 'react-native';
import NumberInput from 'rn-number-input';
<NumberInput
value={this.state.chickenWings}
min={-10}
max={10}
onChange={(value) => this.setState({ chickenWings: value })}
arrowColour='blue'
width={70}
height={40}
/>
<NumberInput />
exposes all the props available to the <TextInput />
plus the following below:
Property | Type | Default | Description |
---|---|---|---|
step | number | 1 | amount in which the value is increased or decreased |
value | string or number | 0 | value shown of the input |
width | number | 70 | specifies the width of the component |
height | number | 40 | specifies the height of the component |
arrowColour | string | #333 (dark grey) | tintColor for the arrow icon |
arrowStyle | style | [default styles] | specifies the style for each arrow button |
valueStyle | style | [default styles] | specifies the style for value within the input |
min | number | 0 | specifies the min value |
max | number | 100 | specifies the max value |
decimalPoints | number | 2 | how many decimal points that the value round's to |
onChange | func (required) | undefined | function is called when the value is changed |
editable | boolean | true | whether the input can be edited directly using the keypad |
MIT Licensed Copyright (c) Cameron Bourke 2016
FAQs
React Native component that behaviors and looks like
The npm package rn-number-input receives a total of 1 weekly downloads. As such, rn-number-input popularity was classified as not popular.
We found that rn-number-input demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.