Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rn-number-input

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rn-number-input

React Native component that behaviors and looks like

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

rn-number-input

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 />

screenshot of the component

Installation

rn-number-input requires react-native 0.20 or later.

npm install --save rn-number-input

Example

To build the example locally, clone this repo then run:

cd example
npm install
react-native (run-ios|run-android)

Usage

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}
/>

Available Props

<NumberInput /> exposes all the props available to the <TextInput /> plus the following below:

PropertyTypeDefaultDescription
stepnumber1amount in which the value is increased or decreased
valuestring or number0value shown of the input
widthnumber70specifies the width of the component
heightnumber40specifies the height of the component
arrowColourstring#333 (dark grey)tintColor for the arrow icon
arrowStylestyle[default styles]specifies the style for each arrow button
valueStylestyle[default styles]specifies the style for value within the input
minnumber0specifies the min value
maxnumber100specifies the max value
decimalPointsnumber2how many decimal points that the value round's to
onChangefunc (required)undefinedfunction is called when the value is changed
editablebooleantruewhether the input can be edited directly using the keypad

Todo

  • Add Unit Tests

License

MIT Licensed Copyright (c) Cameron Bourke 2016

Keywords

FAQs

Package last updated on 14 Mar 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc