react-native-spring-dropdown

1.0.6 • Public • Published

no longer be actively maintained as facebook released offical cross-platform "picker" module in 0.20.0

react-native-spring-dropdown

Support IOS and Android.

My image

Buy me a coffee if you like this

Install

$ npm install react-native-spring-dropdown --save

Basic Usage

var Dropdown = require('react-native-spring-dropdown');
 
...
onChange(options) {
  console.log(options)
}
 
render() {
  return (
    <View style={styles.container}>
      <Dropdown
        data={[{key:1,value:'hello'},{key:2,value:'world'},{key:3,value:'!'}]}
        onChange={this.onChange}
        initValue="Select Me!"
        selectStyle={{width:300,backgroundColor:'#fff'}}
        />
    </View>
  );
}

Props

<Dropdown
  data={[{key:1,value:'hello'},{key:2,value:'world'},{key:3,value:'!'}]}
  onChange={this.onChange}
  initValue="Select Me!"
  selectStyle={{width:300,backgroundColor:'#fff'}}
  optionStyle={{padding:20}}
  optionTextStyle={{color:'blue'}}
  cancelStyle={{padding:20}}
  cancelTextStyle={{color:'red'}}
  overlayStyle={{backgroundColor:'rgba(55,55,55,0.5)'}}
  cancelText="Cancel!"
  />
 

Update

1.0.5 updated android support

1.0.4 added more custom style props

todo

custom styles

Package Sidebar

Install

npm i react-native-spring-dropdown

Weekly Downloads

0

Version

1.0.6

License

MIT

Last publish

Collaborators

  • notlose