Multiselect component for react native
npm i rn-multiselect
<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}
/>
- 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.