Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

multi-select-react

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multi-select-react

Multi Select React – A React Component providing multi select functionality.

  • 0.1.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
289
decreased by-9.97%
Maintainers
1
Weekly downloads
 
Created
Source

multi-select-react

Description

A React Component providing multi select functionality.(under development)


Installation

npm install multi-select-react

Demo

Multi-select-react


1. Basic Usage

import React, { Component } from 'react';
import  MultiSelectReact  from 'multi-select-react';

class MyComponent extends Component {
  constructor() {
        super();
        this.state = {
            multiSelect: []
        };
    }
  render() {
        const selectedOptionsStyles = {
            color: "#3c763d",
            backgroundColor: "#dff0d8"
        };
        const optionsListStyles = {
            backgroundColor: "#fcf8e3",
            color: "#8a6d3b"
        };
    return (
      <MultiSelectReact 
      options={this.state.multiSelect}
      optionClicked={this.optionClicked.bind(this)}
      selectedBadgeClicked={this.selectedBadgeClicked.bind(this)}
      selectedOptionsStyles={selectedOptionsStyles}
      optionsListStyles={optionsListStyles} />
    );
  }

  optionClicked(optionsList) {
        this.setState({ multiSelect: optionsList });
  }
  selectedBadgeClicked(optionsList) {
        this.setState({ multiSelect: optionsList });
  }

}

Props

PropTypeDefaultDescription
selectedOptionsColorobject{}CSS for MultiSelect options selected badges
optionsListStylesobject{}CSS for MultiSelect options drop down
optionsarrayROptions to be pre-populated in select
optionClickedfunctionRCallback, invoked after an option is clicked
selectedBadgeClickedfunctionRCallback, invoked after an selected option badge(tablet) is clicked

Licence

[MIT]

Keywords

FAQs

Package last updated on 18 Aug 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc