Tested with Bootstrap v4.1.1 and Select2 v4.0.6rc1 in latest Firefox, Chrome and Safari (Mac).
- Download the latest release.
- Clone the repo:
git clone https://github.com/berkan52/select2-bootstrap4-theme.git
. - Install with Bower:
bower install select2-bootstrap4-theme
. - Install with npm:
npm install select2-bootstrap4-theme
.
select2-bootstrap4-theme only works with Select2 v4.x. Applying the theme requires select2-bootstrap4.css
referenced after the default select2.css
that comes with Select2:
<link rel="stylesheet" href="select2.css">
<link rel="stylesheet" href="select2-bootstrap4.css">
To apply the theme, tell Select2 to do so by passing bootstrap
to the theme
option when initializing Select2:
$( "#dropdown" ).select2({
theme: "bootstrap4"
});
You may also set it as the default theme for all Select2 widgets like so:
$.fn.select2.defaults.set( "theme", "bootstrap4" );
- Latest build for Bootstrap 4.1.1
- Fixed some bugs when running
npm run dev
;
- Create project
The license is available within the repository in the LICENSE file.