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-multiple-option-picker

v1.2.1

Published

React Native Multiple Option Picker allows seamless integration of both single and multiple selection modes within your app's lists. Featuring a customizable UI, search functionality, and smooth user interactions, this library simplifies selection process

Downloads

26

Readme

react-native-multiple-option-picker

Introducing React Native Multiple Selection: effortlessly integrate single and multiple selection modes into your app's lists. Enjoy a customizable UI, smooth interactions, and comprehensive documentation. Upgrade your React Native app's user experience today!

MultipleSelection React Native Library

A customizable and reusable multiple selection modal component for React Native, allowing users to select items from a list, with search and checkbox options.

Features

  • Single and multiple selection options.
  • Built-in search functionality.
  • Customizable titles, colors, and placeholders.
  • Select All option for multiple selections.
  • Smooth scrolling to selected items.

Examples

Installation

Step 1

npm i react-native-multiple-option-picker --save

or

yarn add react-native-multiple-option-picker

Step 2

iOS

cd ios
pod install

Usage

Import library

import React, { useState } from "react";
import MultipleSelection from "react-native-multiple-option-picker";

const App = () => {
  const [showModal, setShowModal] = useState(false);
  const [selectedItems, setSelectedItems] = useState([]);

  const data = [
    { id: 1, name: "Item 1" },
    { id: 2, name: "Item 2" },
    // Add more items here
  ];

  const handleDone = (selected) => {
    setSelectedItems(selected);
    setShowModal(false);
  };

  return (
    <View style={{ flex: 1 }}>
      <Button title="Show Picker" onPress={() => setShowModal(true)} />
      <MultipleSelection
        show={showModal}
        type="multiple"
        data={data}
        rowTitleKey="name"
        rowUniqueKey="id"
        value={selectedItems}
        pickerTitle="Select Items"
        onDone={handleDone}
        onClose={() => setShowModal(false)}
      />
    </View>
  );
};

Props

| Prop | Type | Default | Description | | ---------------------------- | ------------------------ | ---------------------- | --------------------------------------------------------------------- | | show | boolean | false | Controls the visibility of the modal. | | type | 'single' \| 'multiple' | 'single' | Specifies the selection type, either single or multiple. | | emptyTitle | string | "No Record(s) Found" | Message shown when no items are available in the list. | | enableSearch | boolean | true | Enables or disables the search bar in the modal. | | searchPlaceholder | string | "Search here" | Placeholder text for the search input. | | searchPlaceholderTextColor | ColorValue | '#b1b1b1' | Custom color for the search placeholder text. | | isCapsTitle | boolean | false | If true, the item titles are displayed in uppercase. | | pickerTitle | string | "" | Title of the picker displayed at the top. | | value | string \| any[] | "" | The current selected item(s), can be a empty string, or array. | | data | any[] | [] | The list of items to display in the modal. | | pickerColor | ColorValue | '#8902b3' | Custom color for the picker and text. | | rowUniqueKey | string | "" | The unique key in your data for each item. | | rowTitleKey | string | "" | The key in your data that holds the title to be displayed. | | extraTitleSymbol | string \| '' | "" | A symbol to append after each title (optional). | | extraTitleKey | string \| '' | "" | An additional key for showing extra text in the row title (optional). | | onDone | (data: any) => void | () | Callback function when the user finishes selecting items. | | onClose | () => void | () | Callback function when the modal is closed. |

MIT License

Copyright (c) 2024 PANKAJ KUMAR PRAJAPATI

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.