select2-bootstrap4-theme

js Styles
A theme for Select2 v4 and Bootstrap 4
Version 1.0.0 License MIT
Keywords
bootstrap4select2csssass
<script src=" https://cdn.jsdelivr.net/npm/select2-bootstrap4-theme@1.0.0/Gruntfile.min.js "></script>
<link href=" https://cdn.jsdelivr.net/npm/select2-bootstrap4-theme@1.0.0/dist/select2-bootstrap4.min.css " rel="stylesheet">
No default files set by the package author so the URLs are guessed. You can always browse all package files to use other ones.
Select2 Bootstrap4 Theme
Compatibility
Tested with Bootstrap v4.0.0-beta.2 and Select2 v4.0.5 in latest Chrome and Safari (Mac).
Installation
- 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
.
Usage
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" );
Changelog
Version 1.0.0
- Create project
Copyright and license
The license is available within the repository in the LICENSE file.