# react-native-simple-modal-picker

> Simple Picker/DropDown/Chooser/Selector for React Native

Latest version **0.1.3** (published 2019-04-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-native-simple-modal-picker
pnpm add react-native-simple-modal-picker
yarn add react-native-simple-modal-picker
bun add react-native-simple-modal-picker
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2019-04-05 |
| First published | 2018-09-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Bhavik Charola |
| Maintainers | bhavik_charola |
| Keywords | react-native, react, picker, modal-picker, dropdown, chooser, selector, modal-selector, modal-dropdown |

## Links

- npm: https://www.npmjs.com/package/react-native-simple-modal-picker
- Repository: https://github.com/binbytes/react-native-simple-modal-picker
- Homepage: https://github.com/binbytes/react-native-simple-modal-picker#readme
- Issues: https://github.com/binbytes/react-native-simple-modal-picker/issues
- npm.io page: https://npm.io/package/react-native-simple-modal-picker

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^16.4.2
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2019-04-05
- 0.1.2 — 2019-03-29
- 0.1.1 — 2019-03-28
- 0.1.0 — 2018-09-21

## README

# react-native-simple-modal-picker

Easy to use and fully customized modal picker for both iOS and Android. Have same look and feel in both plateform.

## Installation

`$ npm install react-native-simple-modal-picker --save`

### Properties

| Prop | DataType | Description | IsRequired |
|---|---|---|---|
|**`data`**|Array| Data in json format | true |
|**`value`**|String|Name of field which you want tobe return on selection from array | true |
|**`label`**|String|Name of field which you want tobe shown in list of selection | true |
|**`onValueChange`**|function(value)|Will be called on item selection and get value as a argument| true |
|**`renderRow`**|function(rowData)|Custom component for render row and get row data as a argument| false |

## Usage

Here full [example](https://github.com/binbytes/react-native-simple-modal-picker/tree/master/example) of package usage

#### Simple Modal Picker

```js

<Picker 
  ref={instance => this.simplePicker = instance} 
  data={this.data} 
  label={'name'} 
  value={'value'}
  onValueChange={(value) => alert(value + ' selected')} />

```

![Simple](https://i.imgur.com/xcriwIC.gif)

#### Modal Picker with Custom Row

```js

<Picker 
  ref={instance => this.customRowPicker = instance} 
  data={this.data} 
  label={'name'} 
  value={'value'}
  onValueChange={(value) => alert(value + ' selected')}
  renderRow={(rowData) => <Text style={styles.rowStyle}>{rowData.name}</Text>} />

```

![Custom](https://i.imgur.com/NSZ0NfW.gif)

#### DropDown View

```js

<View>
  <Picker 
    ref={instance => this.dropDownPicker = instance} 
    data={this.data} 
    label={'name'} 
    value={'value'}
    onValueChange={(value, selectedIndex) => this.setState({selectedIndex})} />
  <View style={styles.subContainer}>
    <TouchableOpacity style={styles.dropDownContainer} onPress={() => this.dropDownPicker.setModalVisible(true)}>
      <Text style={styles.dropDownText}>{this.data[this.state.selectedIndex].name}</Text>
    </TouchableOpacity>
  </View>
</View>

```

![DropDown](https://i.imgur.com/rPTVTh6.gif)

---
_Source: https://npm.io/package/react-native-simple-modal-picker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
