1.0.4 • Published 7 years ago

react-native-multiple-select-list v1.0.4

Weekly downloads
142
License
MIT
Repository
github
Last release
7 years ago

react-native-multiple-select-list

Multiple select list with search bar

Install :

npm install --save react-native-multiple-select-list

Example usage :

import CustomMultiPicker from "react-native-multiple-select-list";

const userList = {
  "123":"Tom",
  "124":"Michael",
  "125":"Christin"
}

<CustomMultiPicker
  options={userList}
  search={true} // should show search bar?
  multiple={true} //
  placeholder={"Search"}
  placeholderTextColor={'#757575'}
  returnValue={"label"} // label or value
  callback={(res)=>{ console.log(res) }} // callback, array of selected items
  rowBackgroundColor={"#eee"}
  rowHeight={40}
  rowRadius={5}
  iconColor={"#00a2dd"}
  iconSize={30}
  selectedIconName={"ios-checkmark-circle-outline"}
  unselectedIconName={"ios-radio-button-off-outline"}
  scrollViewHeight={130}
  selected={[1,2]} // list of options which are selected by default
/>

react-native-multiple-select-list

Props:

PropTypeDescription
optionsObjectlist of options/items
searchBooleanif the search bar should be shown or not
multipleBooleanif user can select multiple options or not. if you select an item which is already selected, it will be unselected. if multiple is disabled, it will work like radio buttons.
placeholderStringplaceholder text for search bar
placeholderTextColorStringplaceholder text color for search bar
returnValueStringshould it return keys of selected options or values?
callbackFunctionwhenever user selects or changes selections it will be called.
rowBackgroundColorStringbackground color for each row in list
rowHeightIntegerrow height
rowRadiusIntegerrow border radius
iconColorStringicon color for checked/unchecked icons and search icon also border color of search bar
iconSizeIntegericon size for checked/unchecked icons
selectedIconNameStringselected/checked icon name (react-native-vector-icons/Ionicon)
unselectedIconNameStringunselected/unchecked icon name (react-native-vector-icons/Ionicon)
scrollViewHeightIntegerscrollview height (list of items)
selectedObjectlist of options which are selected by default

Author:

Ata S.Mohammadi. ataomega@gmail.com