rn-multiselect
v1.2.2
Published
Multiselect component for React Native
Downloads
10
Maintainers
Readme
RN Multiselect
Multiselect component for react native
Install
npm i rn-multiselect
Usage
<MultiSelect
data={[{key:1, label:'Option 1'}, {key:2, label:'Option 2'}, {key:3, label:'Option 3' } ]}
selectedOptions={[1,2]}
onChange={values => this.setState({ selectedOptions: values })}
modalFooterText="Submit"
placeholder="Click here to choose"
displayOptionsLimit={5}
/>
Props
- data (required): Options, expect an array of objects with key and label
- selectedOptions: Selected options, expect an array of selected options's keys
- onChange: Function that is called when a option is selected, returns selected options
- modalFooterText: Text displayed on modal's footer
- placeholder: Text displayed when there is no tag selected
- displayOptionsLimit: Limit of selected options displayed, default is 2.