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

react-mobile-picker

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-mobile-picker

An iOS like select box component for React

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10K
decreased by-2.49%
Maintainers
1
Weekly downloads
 
Created
Source

React Mobile Picker

React Mobile Picker is a super simple component with no restriction, which means you can use it in any way you want.

Preview

qr

Scan this Qr in you mobile.

Or visit (in mobile or mobile simulator): http://adcentury.github.io/react-mobile-picker

Install

npm install react-mobile-picker --save

Usage

ES6

import Picker from 'react-mobile-picker';

CommonJS

var Picker = require('react-mobile-picker');

Props

optionGroups [required]

  • Description Option groups as {name: options}. Key is the name of options, and value is an array of all options for this name.

  • Type: Object

  • Examples

{
  title: ['Mr.', 'Mrs.', 'Ms.', 'Dr.'],
  firstName: ['John', 'Micheal', 'Elizabeth'],
  secondName: ['Lennon', 'Jackson', 'Jordan', 'Legend', 'Taylor']
}

valueGroups [required]

  • Description: Selected value groups as {name: value}. React Mobile Picker is a Controlled Component, which means the selected value of the rendered element will always reflect the valueGroups.
    Every time you want to change the selected item, just modify valueGroups.

  • Type: Object

  • Examples

{
  title: 'Mr.',
  firstName: 'Micheal',
  secondName: 'Jordan'
}

onChange(name, value) [required]

  • Description Callback of selected value changing event. First parameter is the name of options, and second is the selected option's value.

  • Type: Function

  • Examples

handleChange = (name, value) => {
  this.setState(({valueGroups}) => ({
    valueGroups: {
      ...valueGroups,
      [name]: value
    }
  }));
}

itemHeight

  • Description Height of each item (that is each option). In px.

  • Type: Number

  • Default: 36

height

  • Description Height of the picker. In px.

  • Type: Number

  • Default: 216

License

MIT.

Keywords

FAQs

Package last updated on 13 Jan 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