2.0.2 • Published 9 years ago

react-native-prefix-picker v2.0.2

Weekly downloads
11
License
MIT
Repository
github
Last release
9 years ago

React Native Prefix Picker Build Status react-native-prefix-picker Codacy Badge npm version Gitter

A simple iOS and Android picker for React Native

Introduction

React Native Prefix Picker is simple, customizable and easy to use Picker in React Native. Works with both Android and IOS.

NEW VERSION

Now the prefixs are preloaded

Installation

npm i react-native-prefix-picker --save

Demo

Usage

import React, {
  Component,
  View,
  Text,
} from 'react-native';
import { Select} from 'react-native-prefix-picker';

class Login extends Component {

  constructor(props) {
    super(props);
    this.state = {
      prefix: '',
    };
  }

  render() {
    return (
      <View
        style={{
          flex: 1,
          backgroundColor: 'white',
          marginTop: 80,
          padding: 20,
        }}
      >
        <Picker
          style={{
            width: 80,
            height: 64,
            marginRight: 8,
          }}
          styleLabel={{
            fontSize: 14,
          }}
          styleValue={{
            fontSize: 14,
          }}
          transparent
          onSubmit={(option) => {
            this.setState({
              prefix: option,
            });
          }}
        />
        <Text
          style={{
            fontSize: 40,
            textAlign: 'center',
            margin: 10,
            color: '#f87f1d',
          }}
        >
          TEST
        </Text>
      </View>
    );
  }
}

export default Login;

Configuration

Picker:
PropertyTypeDefaultDescription
styleobjectCustom styles to be applied if supplied
styleLabelobjectCustom styles to be applied if supplied
styleValueobjectCustom styles to be applied if supplied
itemStyleobjectCustom styles to be applied if supplied.
buttonColorstring#007AFFCustom styles to be applied if supplied.
disabledboolfalseIf true, disable all interactions for this component.
selectedValuestringnullThe default value.
onSubmitfunctionrequiredfunction will be called when item button is pressed
transparentboolfalseTransparent style for Modal
2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago