​Select2 gives you a customizable select box with support for searching, tagging, remote data sets, infinite scrolling, and many other highly used options.
Select2 for WireBootstrap brings Select2 into the WireBootstrap framework providing a powerful way of filtering data in applications developed with Bootstrap themes.
Installation
The Select2 for WireBootstrap library is located in wire-select2.js. This and other other related files can be installed from the NPM package registry at@wirebootstrap/wire-select2.
1
npm install @wirebootstrap/wire-select2
Copied!
Select2 for WireBootstrap will load select2.full.min.js from a CDN if it's not found on the page.
Select2 for WireBootstrap will load select2.min.css from a CDN if not found on the page.
Class
Select2 for WireBootstrap extends the wire.ui.component class. As such, it inherits all the base functionality of that class.
To create a new instance of the Select2 for WireBootstrap component, use the wire.select2 class.
1
const select2 =newwire.select2();
Copied!
Render
Render the component using an HTML select element.