A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists!
v1.1.0
- π Zero-dependencies and extremely lightweight!
- π¦Ύ Written in TypeScript, allowing greater support for React, Angular, and other libraries!
- βοΈ Maintains existing SELECT DOM element for FORM compatibility, allowing easy editing.
- βοΈ Easily select and de-select your list items, which are shown as tags!
- π» Full API available via public functions.
- π± Fully styled in CSS/SASS (including the buttons) and compatible with the Bootstrap library.
- π Full CSS theme support (using :root variables, with a default dark-mode theme).
- π Custom triggers for actions (when elements are rendered, selection is changed, etc).
- π Shortcut keys (click here to see the full list).
All modern browsers (such as Google Chrome, FireFox, and Opera) are fully supported.
To see a list of all the most recent changes, click here.
You can install the library with npm into your local modules directory using the following command:
npm install jselect.js
To get started using Select.js, do the following steps:
Make sure you include the "DOCTYPE html" tag at the top of your HTML, as follows:
<!DOCTYPE html>
<link rel="stylesheet" href="dist/select.js.css" />
<script src="dist/select.js"></script>
<select multiple="multiple" data-select-js="{ 'render': true }">
<option value="1" selected="selected">Value 1</option>
<option value="2">Value 2</option>
<option value="2">Value 3</option>
</select>
<select data-select-js="{ 'render': true }">
<option value="1">Value 1</option>
<option value="2">Value 2</option>
<option value="2">Value 3</option>
</select>
To see a list of all the available binding options you can use for "data-select-js", click here.
To see a list of all the available custom triggers you can use for "data-select-js", click here.
That's it! Nice and simple. Please refer to the code if you need more help (fully documented).
To customize, and get more out of Select.js, please read through the following documentation.
To see a list of all the public functions available, click here.
Configuration options allow you to customize how Select.js will function. You can set them as follows:
<script>
$select.setConfiguration( {
safeMode: false
} );
</script>
To see a list of all the available configuration options you can use, click here.