npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-multiselect-view2

v1.0.6

Published

Custom multi list component for react native, it works on iOS and Android like a charm.

Downloads

42

Readme

react-native-multiselect-view

release NPM version PRs Welcome License MIT

MultiSelectView component for react native to select multiple items smoothly with minimum efforts, it works on iOS and Android like a charm.

Content

Modified Version

Modified Version

This version of react-native-multiselect-view is a tweaked version of the original. It includes the following modification:

In line 28 of the index.js file, the code was updated to fix an error that displayed "valueKey doesn't exist" when trying to create a multiselect view from an array of objects. The change made was adding props in value: item[props.valueKey]:

constructor(props) {
  super(props);
  this.onTouch = this.onTouch.bind(this);
  let newData = [];
  props.data.forEach((item) => {
    if (typeof item !== 'string' && typeof item !== 'number') {
      newData.push({ ...item, value: item[props.valueKey], checked: false });
    } else {
      newData.push({ value: item, checked: false });
    }
  });
  this.state = {
    data: newData,
  };
}

Please note that this modified version is intended for a specific use case and may not be compatible with the original package or receive updates from the original maintainer.

Demo

Screenshots

Installation

  • 1.Run npm i react-native-multiselect-view --save
  • 2.import MultiSelectView from 'react-native-multiselect-view'

Getting started

Add react-native-multiselect-view to your js file.

import MultiSelectView from 'react-native-multiselect-view'

Inside your component's render method, use MultiSelectView:

Example 1

<MultiSelectView
    ref='list1'
    onSelectionStatusChange={this.onSelectionStatusChange}
    data={LoremIpsum}
    valueKey={'value'}
/>

Example 2

<MultiSelectView
    ref='list2'
    data={LoremIpsum1}
    activeContainerStyle={styles.activeCom}
    inactiveContainerStyle={styles.inactiveCom}
    activeTextStyle={styles.activeText}
    inactiveTextStyle={styles.inactiveText}
/>

Example 3

<MultiSelectView
    ref='list3'
    data={LoremIpsum2}
    activeIcon={<Ionicons name='md-checkmark-circle' size={16} style={styles.icon} />}
    inactiveIcon={<Ionicons name='md-log-in' size={16} style={styles.icon} />}
/>

API

Props | Type | Optional | Default | Description ----------------- | -------- | -------- | ----------- | ----------- activeContainerStyle | View.propTypes.style |true | backgroundColor: '#BDD358',borderColor: 'transparent'|Active or selected Container Style inactiveContainerStyle| View.propTypes.style | true | |Inactive Container Style activeTextStyle | Text.propTypes.style |true | color: '#fff' | Style for Active Text inactiveTextStyle | Text.propTypes.style | true | | Style for Inactive Text activeIcon | PropTypes.element | true | Icon | Icon for Active Container inactiveIcon | PropTypes.element | true | false | Icon for Inactive Container onSelectionStatusChange | PropTypes.func | true | | Function to perform on any item selection state change valueKey | PropTypes.string | false if data is array of object | | Text or key to show in container data | PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object]) | false | | Array of list to be displayed

Other popular components

https://github.com/bgoyal2222/react-native-checkbox-component

MIT Licensed