Select2
Select2 for WireBootstrap
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 = new wire.select2();
Copied!

Render

Render the component using an HTML select element.
JavaScript
React
Vue
Angular
1
<select id="select" class="form-control"></select>
2
<script>
3
new wire.select2().render("#select", {});
4
</script>
Copied!
1
<WireComponent component="wire.select2" config={}>
2
<select className="form-control"></select>
3
</WireComponent>
Copied!
1
<select wire-component="wire.select2" v-wire-config="" class="form-control"></select>
Copied!
1
<select wire-component="wire.select2" [config]="" class="form-control"></select>
Copied!
Copy link