Skip to content

Multi-Select Dropdown with Checkboxes

Bootstrap 5 multi-select dropdown with checkboxes, live search, select all and clear, a selected count badge and removable chips.

Also known as: multiselect dropdown, checkbox dropdown, multiple select with search, dropdown with selected chips

Bootstrap 5 Selects Responsive #checkbox #dropdown #filter #form #select

Multi-Select Dropdown with Checkboxes live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A Bootstrap 5 multi-select dropdown that lets users tick several options from a checkbox list, then shows how many are selected in a count badge and as removable chips below the field. The demo is a candidate filter; the pattern also suits product filters and tag pickers.

How it works

Each field is a .msc-select.dropdown wrapper with a .msc-label, a .msc-toggle button using data-bs-toggle="dropdown", a .msc-menu and a .msc-chips list. The toggle sets data-bs-auto-close="outside", so the menu stays open while users tick several boxes and closes on an outside click or Escape. Inside the menu, the optional .msc-search input sits above .msc-options, a scrollable group of real form-check checkboxes with name and value attributes, followed by .msc-empty and a .msc-footer with Select all and Clear buttons.

The script initialises every .msc-select on DOMContentLoaded. Its render() function reads the checked boxes and writes them into .msc-value (up to MAX_NAMES labels, then "+N more"), updates the .msc-count badge and rebuilds the chips. Typing in the search box hides options whose label does not match; Select all and Clear only affect the options that are currently visible, which makes bulk picks after a search easy. A chip's remove button unchecks its option. Because the values are ordinary checkboxes, the parent form submits them without any extra hidden inputs; the demo form prevents the submit and prints a summary instead.

Customization

  • --msc-accent in .msc-demo: changes the badge, checked boxes, chips, focus ring and primary button.
  • --msc-menu-height in .msc-demo: sets how tall the option list grows before it scrolls.
  • --msc-radius in .msc-demo: rounds or squares the toggle and the menu.
  • data-msc-placeholder on .msc-select: the text shown when nothing is selected, such as "Any skill".
  • data-msc-open on .msc-select: opens that dropdown on page load; remove it for normal behavior.
  • MAX_NAMES at the top of script.js: how many option names appear in the button before switching to "+N more".
  • Delete the .msc-search block from a menu to drop the search field for short lists, as in Locations.
  • The form submit handler in script.js: replace the summary with a fetch() call that sends new FormData(form).

Use cases

  • Candidate filters: recruiters tick several skills and see the count badge and removable chips
  • Product filters: shoppers choose multiple categories from a searchable checkbox list with select all and clear
  • Tag pickers: authors search a long list of tags and pick several, shown as chips below the field
  • Forms with many options: the checked values submit with the form without extra hidden inputs

Accessibility

The toggle is a real button with aria-expanded managed by Bootstrap and an aria-labelledby that combines the field label and the current value, so screen readers hear "Skills, HTML, CSS +1 more". Options are native checkboxes with clickable labels inside a labelled role="group", reachable with Tab and toggled with Space. Opening a menu with search moves focus to the search field, and typing there does not trigger dropdown navigation. Chip buttons have an aria-label such as "Remove CSS" and return focus to the toggle. The .msc-result line is a live region, and focus states use a visible violet outline.

Usage notes

Requires Bootstrap 5 with its JavaScript bundle (added automatically) and Bootstrap Icons. Give each checkbox a unique id when you add more fields.

Multi-Select Dropdown with Checkboxes at a glance

Framework
Bootstrap 5
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 5, Bootstrap Icons
Layout
Responsive, works on mobile
Category
Selects
License
Free for personal and commercial use

Questions about this template

Can I use the Multi-Select Dropdown with Checkboxes code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 5 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
  • <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
Multi-Select Dropdown with Checkboxes – Bootstrap 5 selects component screenshot
Multi-Select Dropdown with Checkboxes · Bootstrap 5 Selects

More Selects

Styled Native Select – Pure CSS selects preview

Styled Native Select

Pure CSS restyle of the native select element with a custom arrow, focus ring, error, success and disabled states, and three sizes.

Searchable Select – Tailwind CSS selects preview

Searchable Select

Accessible Tailwind CSS combobox that filters options as you type, highlights matches and supports full keyboard navigation.