Have ideas to improve npm?Join in the discussion! »

multiple-select-js

1.2.6 • Public • Published

Multiple Select

A simple javascript library for multiple select component that supports Bootstrap 4 natively.

Installation

You can install multiple-select-js in 3 options:

Using NPM

npm i multiple-select-js

And then, simply import it using es6 syntax.

import MultipleSelect from 'multiple-select-js'

Using CDN

<!-- Bootstrap 4 -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
 
<!-- Multiple Select JS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/multiple-select-js/dist/css/multiple-select.css">
<script src="https://cdn.jsdelivr.net/npm/multiple-select-js/dist/js/multiple-select.js"></script>

Manually Download

<link href="/dist/css/multiple-select.css" rel="stylesheet">
<script src="/dist/js/multiple-select.js"></script>

Basic Usage

For single select.

<div class="form-group">
  <label for="select-language">Single Select</label>
  <select id="select-language">
    <option value="php">PHP</option>
    <option value="javascript">Javascript</option>
    <option value="python">Python</option>
    <option value="java">Java</option>
  </select>
</div>
new MultipleSelect('#select-language', {
  placeholder: 'Select Language'
})

For Multiple select you can simply add multiple attribute to the select tag.

<div class="form-group">
  <label for="select-language">Multiple Select</label>
  <select id="select-multiple-language" multiple>
    <option value="php">PHP</option>
    <option value="javascript">Javascript</option>
    <option value="python">Python</option>
    <option value="java">Java</option>
  </select>
</div>
new MultipleSelect('#select-multiple-language', {
  placeholder: 'Select Language'
})

Documentation

Go to this link for the complete documentation.

License

The Multiple Select Js library is open-source software licensed under the MIT license.

Install

npm i multiple-select-js

DownloadsWeekly Downloads

113

Version

1.2.6

License

MIT

Unpacked Size

227 kB

Total Files

27

Last publish

Collaborators

  • avatar