0.1.4 • Published 7 years ago

react-native-js-cascade-picker v0.1.4

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

react-native-js-cascade-picker

A pure JavaScript animated component that renders a picker with a cascade effect. Useful for navigation bars.

Getting started

$ yarn add react-native-js-cascade-picker

Usage

import CascadePicker from 'react-native-js-cascade-picker'

// Render your component
<CascadePicker
  options={[{ value: 2, label: 'Two' }, { value: 4, label: 'Four' }]}
  valueSelected={this.state.val}
  onChange={(option: ?Object) => {
    if (option) {
      this.setState({ val: option.value })
    }
  }}
  pickerText='Select one'
/>

API

PropsTypeDescriptionRequired
optionsArray<Option>Yes
pickerTextstringYes
onChangeFunctionReturns an Option.Yes
valueSelectedanyA value to match into the Options.
mainColorstring
selectedColorstringColor for the selected item.
itemColorstringColor for the items.
separatorColorstringColor for the separator.
selectedTextColorstring
optionTextStyleanyStyle for the text option.

License

MIT.

Author

Álvaro Medina Ballester <amedina at apsl.net>

Built with 💛 by APSL.