Code Monkey home page Code Monkey logo

react-native-multiple-select-list's Introduction

react-native-multiple-select-list

Multiple select list with search bar

Install :

npm install --save https://github.com/rupal-simform/react-native-multiple-select-list

Example usage :

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

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

//const userList = {
//  "123":<View><Text>Tom</Text></View>,
//  "124":<View><Text>Michael</Text></View>,
//  "125":<View><Text>Christin</Text></View>
//}

<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}
  searchIconName="ios-checkmark"
  searchIconColor="red"
  searchIconSize={30}
  iconColor={"#00a2dd"}
  iconSize={30}
  selectedIconName={"ios-checkmark-circle-outline"}
  unselectedIconName={"ios-radio-button-off-outline"}
  scrollViewHeight={130}
  selected={["Tom", "Christin"]} // list of options which are selected by default
/>

react-native-multiple-select-list

Props:

Prop Type Description
options Object list of options/items
search Boolean if the search bar should be shown or not
multiple Boolean if 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.
placeholder String placeholder text for search bar
placeholderTextColor String placeholder text color for search bar
returnValue String should it return keys of selected options or values?
callback Function whenever user selects or changes selections it will be called.
rowBackgroundColor String background color for each row in list
rowHeight Integer row height
rowRadius Integer row border radius
searchIconName String Name of the vector icon displayed on the search bar
searchIconSize Integer icon size for the icon displayed on the search bar
searchIconColor String icon color the icon displayed on the search bar
iconSize Integer icon size for checked/unchecked icons
iconColor String icon color for checked/unchecked icons and search icon also border color of search bar
iconSize Integer icon size for checked/unchecked icons
selectedIconName String selected/checked icon name (react-native-vector-icons/Ionicon)
unselectedIconName String unselected/unchecked icon name (react-native-vector-icons/Ionicon)
scrollViewHeight Integer scrollview height (list of items)
selected Object list of options which are selected by default
scrollViewStyle Object Style object for scrollView that holds all items
itemStyle Object Style object for the touchableOpacity of each item
labelStyle Object Style object for the text label
selectedIconStyle Object style object for the icon when selected
unselectedIconStyle Object style object for the icon when unselected

Author:

Ata S.Mohammadi. [email protected]

react-native-multiple-select-list's People

Contributors

atasmohammadi avatar bilal-abdeen avatar compojoom avatar mallelapavank avatar rupal-simform avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.