A lightweight jQuery plugin that replaces native select elements with customizable dropdowns.
npm i nice-select2
Include nice-select2 script.
<script src="path/to/nice-select2.js"></script>
Include the styles, either the compiled CSS...
<link rel="stylesheet" href="path/to/nice-select2.css">
Or import nice-select2 using ES6 syntax
import NiceSelect from 'nice-select2';
@import '~nice-select2/dist/css/nice-select2.css';
// or
@import '~nice-select2/src/scss/nice-select2.scss';
Finally, initialize the plugin.
NiceSelect.bind(document.getElementById("#a-select"));
Full documentation and examples at https://bluzky.github.io/nice-select2/.