JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 703
  • Score
    100M100P100Q114673F
  • License MIT

A dropdown solution that can handle written in React.js. Styled with Boostrap 4.

Package Exports

  • react-multiselect-dropdown-bootstrap

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-multiselect-dropdown-bootstrap) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-multiselect-dropdown-bootstrap

A React.js component to easy create dropdowns that allows multiple option selection.

Examples

Here is an example with default settings when only an array with options is provided:

Default settings

How to install

npm install react-multiselect-dropdown-bootstrap

Then you need to import it and place somewere in your app. Here is an example for default setup:

import React from "react";
import DropdownMultiselect from "react-multiselect-dropdown-bootstrap";

class SomeSection extends React.Component {
  render() {
    return (
      <DropdownMultiselect
        options={["Australia", "Canada", "USA", "Poland", "Spain", "France"]}
        name="countries"
      />
    );
  }
}

export default SectionTwo;

Available props

Required

  • options - an array with available options
  • name - a string with the name (just like for normal html inputs)

Optional

  • selected - an array with options that should be selected as default
  • handleOnChange - a callback function to run when selected options will be changed. A "selected" param is available. It contains an array of currently selected options. Example:
handleOnChange={(selected) => {
  props.changeMarket(selected);
}}
  • placeholder - default value is "Nothing selected"
  • buttonClass - you can specify a css class for button. Default is "btn-light"