rn-cascade-picker
v2.0.0
Published
A cascade picker component written in pure JavaScript for React Native
Downloads
25
Maintainers
Readme
rn-cascade-picker
A cascade picker component written in pure JavaScript for React Native
Installation
yarn add rn-cascade-picker
Peer Dependencies
"react": ">= 16.13.1",
"react-native": ">= 0.63.4"
Usage
# demo
cd example
yarn
yarn ios
Props
| Prop | Type | Default | Description |
| ---------------- | ---------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------- |
| visible | Boolean | false | determine whether Picker is visible or not |
| data | Array<{value, label, children: Array}>
| - | data source |
| value | Array | - | the value, the format is [value1, value2, value3], corresponds to the level value of the data source |
| cols | Number | 3
| col numbers |
| title | String | - | title |
| cancelText | String | cancel
| cancel text |
| confirmText | String | confirm
| confirm text |
| titleTextStyle | Object | - | style of title text |
| cancelTextStyle | Object | - | style of cancel text |
| confirmTextStyle | Object | - | style of confirm text |
| onCancel | (): void | - | cancel handler |
| onConfirm | (val): void | - | confirm handler |
Contribution
If you want to add some features, feel free to submit PR.
License
MIT.