snapappointments /bootstrap-select
:rocket: The jQuery plugin that brings select elements into the 21st century with intuitive multiselection, searching, and much more.
★ 9,807⑂ 2,652👁 325⑃ 604● 2,250▤ 75
+0
日增长
9,807
stars
2,652
forks
325
watchers
604
prs
2,250
issues
75
releases
README
bootstrap-select
The jQuery plugin that brings select elements into the 21st century with intuitive multiselection, searching, and much more. Now with Bootstrap 5 support.
Demo
You can view a live demo and some examples of how to use the various options here.
Quick start
Bootstrap-select requires jQuery v1.9.1+, Bootstrap’s dropdown.js component, and Bootstrap's CSS. If you're not already using Bootstrap in your project, a precompiled version of the Bootstrap v3.4.1 minimum requirements can be downloaded here. If using bootstrap-select with Bootstrap v4+, you'll also need Popper.js. For all of Bootstrap v4's requirements, see Getting started. A precompiled version of the requirements will be made available in an upcoming release of bootstrap-select.
Several quick start options are available:
- Download the latest release.
- Clone the repo: git clone https://github.com/snapappointments/bootstrap-select.git
- Install with npm: npm install bootstrap-select
- Install with yarn: yarn add bootstrap-select
- Install with Composer: composer require snapappointments/bootstrap-select
- Install with NuGet: Install-Package bootstrap-select
- Install with Bower: bower install bootstrap-select
- Install via CDN (cdnjs, jsDelivr or PageCDN):
html
The CDN is updated after the release is made public, which means that there is a delay between the publishing of a release and its availability on the CDN.
Usage
Bootstrap 4 only works with bootstrap-select v1.13.0+. By default, bootstrap-select automatically detects the version of Bootstrap being used. However, there are some instances where the version detection won't work. See the documentation for more information.
Via selectpicker class
Add the selectpicker class to your select elements to auto-initialize bootstrap-select.
html
Mustard
Ketchup
Barbecue
Via JavaScript
js
// To style only selects with the my-select class
$('.my-select').selectpicker();
or
js
// To style all selects
$('select').selectpicker();
If calling bootstrap-select via JavaScript, you will need to wrap your code in a .ready() block or place it at the bottom of the page (after the last instance of bootstrap-select).
js
$(function () {
$('select').selectpicker();
});
Check out the documentation for further information.
Bugs and feature requests
Anyone and everyone is welcome to contribute. Please take a moment to
review the guidelines for contributing. Make sure you're using the latest version of bootstrap-select before submitting an issue.
Bug reports
Feature requests
Documentation
Bootstrap-select's documentation, included in this repo in the root directory, is built with MkDocs and hosted at https://developer.snapappointments.com/bootstrap-select. The documentation may also be run locally.
Copyright and license
Copyright (C) 2012-2018 SnapAppointments, LLC
Licensed under the MIT license.Top issues
#2228v2.0.0 Roadmap35 comments · 2019-03-13#737Ability to select/deselect all optgroup items34 comments · 2014-09-16#2837it works very well (bootstrap-select-v1.14.0-beta3-updated and bootstrap 5.3.0)25 comments · 2023-07-21#2738Options and selection are duplicated25 comments · 2022-05-03#862bootstrap-select doesn't support RTL12 comments · 2015-01-14#2724Bootstrap select dropdown items not synchronized with underlying native select options after dynamic add/remove and refresh from code11 comments · 2022-04-11#1511Option to not focus live search when opened11 comments · 2016-09-14#2759Can't get v1.13.8 dropdown to work10 comments · 2022-07-08
Discussions
#2888Bootstrap-select issue2 comments · 2026-04-17#2875Does anyone know what styles and code is required from Boostrap1 comments · 2024-08-21#2864麻烦问下首页这个代码在哪里可以看0 comments · 2024-02-28#2862Bootstrap select as toggle button0 comments · 2024-02-07#2860Two dropdowns in one page possible?1 comments · 2024-01-19#2854dropdown empty not working0 comments · 2023-11-29#2850Blank lines at the beginning1 comments · 2023-11-03#2839While using the live search option hide the button and have the search textbox showing in place of the button0 comments · 2023-08-01
Latest release
v1.13.18 v1.13.18 2020-06-26Bug Fixes - 1342: Bootstrap select doesn't send field data on form submit (set form attribute on select element to fix) - 2402: In Internet Explorer, with liveSearchPlaceholder enabled, can't select option while searchBox is focused. Also, selected option doesn't get scrolled to when opening menu - 2464: title attribute does not work in 1.13.17 (Safari) - 2469: Shift-Tab key not working in 1.13.17 - 2474: With multiple selects, cannot select options with keyboard after using mouse to select options - 2483: Dropdown with unselectable index 0 will not scroll to top on arrow_down with last