A Select2 v4 Theme for Bootstrap v5.0.0-beta1
Built and tested with Bootstrap v5.0.0-beta1 and Select2 v4.0.13 in the latest Chrome, Firefox. It will support both rtl and ltr direction.
You can download select2 bootstrap5 theme from this GitHub repo, and install the compiled CSS with bellow instructions.
select2 bootstrap5 theme only works with Select2 v4.x. Applying the theme requires select2-bootstrap5.min.css
referenced after the default select2.min.css
that comes with Select2:
<link rel="stylesheet" href="select2.min.css">
<link rel="stylesheet" href="select2-bootstrap5.min.css">
<script src="select2.min.js" type="text/javascript"></script>
To apply the theme, tell Select2 to do so by passing bootstrap5
to the theme
option when initializing Select2:
$( "#your-dropdown" ).select2({
theme: "bootstrap5"
});
You may also set it as the default theme for all Select2 widgets like so:
$.fn.select2.defaults.set( "theme", "bootstrap5" );
The first release
This theme created by Morteza Fard Saffari (ArizoTech Co.) And licensed under MIT License