1.0.6 • Published 8 years ago

react-native-spring-dropdown v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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