Socket
Socket
Sign inDemoInstall

react-search-multi-select

Package Overview
Dependencies
8
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-search-multi-select

A React component which is a single/multiselect with Search option and fully customizable


Version published
Weekly downloads
45
increased by246.15%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

React-Search-Multi-Select

A simple customisable React component with Select/Multi Select and Search

  • Fully Customizable - color, width, height, background etc
  • Combines Search functionality with multi-select and tags
  • Choose between multi/single select, display tags or not and allow search or not
  • Ideal for multi/single select with huge number of data and avoids scrolling much

Installation

Dillinger requires [React.js and Prop-Types] to run.

$ npm i react-search-multi-select

Demo

Online Demo Link

How to Use

Install and import react-search-multi-select and pass the props

import React, { Component } from "react";
import MultiSearchSelect from "react-search-multi-select";

class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      values: ["Allison","Arthur","Beryl","Chantal","Cristobal","Danielle","Dennis","Ernesto","Felix","Fay","Grace","Gaston","Gert","Gordon"]
    };
  }
  handleChange = (arr) => {
    console.log(arr);
  }
  render() {
    return (
      <div style={{display: 'flex', justifyContent: 'center'}}>
        <MultiSearchSelect searchable={true} showTags={true} multiSelect={true} width="500px" onSelect={this.handleChange} options={this.state.values}/>
      </div>
    );
  }
}

export default App;

Props:

Prop-Types:
{
    options: PropTypes.array.isRequired,
    optionsContainerHeight: PropTypes.string,
    searchPlaceholder: PropTypes.string,
    width: PropTypes.string,
    primaryColor: PropTypes.string,
    secondaryColor: PropTypes.string,
    textColor: PropTypes.string,
    textSecondaryColor: PropTypes.string,
    className: PropTypes.string,
    searchable: PropTypes.bool,
    showTags: PropTypes.bool,
    multiSelect: PropTypes.bool,
    onSelect: PropTypes.func.isRequired,
    onUserInput: PropTypes.func, /* Function to get values typed by user in Search box */
}
Default-Props
{
    optionsContainerHeight: "50vh",
    searchPlaceholder: "Search...",
    className: "",
    width: "200px",
    primaryColor: "#e1e1e1",
    secondaryColor: "#046fc0",
    textColor: "#000",
    textSecondaryColor: "#fff",
    searchable: true,
    showTags: true,
    multiSelect: true
}

Contribution

You are welcome to raise issues and PRs in the repository

Keywords

FAQs

Last updated on 11 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc