0.0.4 • Published 5 years ago

@paraboly/react-native-multiselect v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Basic Multiselect Button Screenshots

Installation

Add the dependency:

npm i @paraboly/react-native-multiselect

Peer Dependencies

"react": ">= 16.x.x",
"react-native": ">= 0.55.x",
"lodash": ">= 4.17.15",

Usage

Import

import Multiselect from "@paraboly/react-native-multiselect";

Usage

Do not forget to check Example Data to make it work

 <Multiselect
        data={staticData}
        onPress={res => console.log(res)}
        onChange={res => console.log(res)}
  />

Example Data

const staticData = [
  {
    id: 0,
    text: "Yüksek",
    features: {
      height: 40,
      width: 70,
      activeButtonColor: "#a085af",
      inactiveButtonColor: "#dbdbdb",
      activeTextColor: "#eaeaea",
      inactiveTextColor: "#848484"
    }
  },
  {
    id: 1,
    text: "Orta",
    features: {
      height: 40,
      width: 70,
      activeButtonColor: "#a085af",
      inactiveButtonColor: "#dbdbdb",
      activeTextColor: "#eaeaea",
      inactiveTextColor: "#848484"
    }
  },
  {
    id: 2,
    text: "Düşük",
    features: {
      height: 40,
      width: 70,
      activeButtonColor: "#a085af",
      inactiveButtonColor: "#dbdbdb",
      activeTextColor: "#eaeaea",
      inactiveTextColor: "#848484"
    }
  }
];

Configuration - Props

PropertyTypeDefaultDescription
heightstyle40set your own height
widthstyle70set your own width
activeButtonColorstyle#a085afuse this to change the active color of the button
inactiveButtonColorstyle#dbdbdbuse this to change the inactive color of the button
activeTextColorstyle#eaeaeause this to change the active color of the text
inactiveTextColorstyle#848484use this to change the inactive color of the text
onChangefunctionundefinedyou can make your business logic or get the selection of the data from this function
onPressfunctionundefinedonPress function for each of them

Author

Şevval Eygül

License

React Native Multiselect Button Group is available under the MIT license. See the LICENSE file for more info.