VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-dropdowns-disabled/

⇱ Bootstrap 5 Dropdowns Disabled - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Dropdowns Disabled

Last Updated : 23 Jul, 2025

Bootstrap 5 Dropdowns Disabled is used to disable some text items in the dropdown. A disabled drop-down list is unusable and un-clickable. 

Bootstrap 5  Dropdowns Disabled classes: There is no specific class for the Bootstrap 5 Dropdowns disabled feature, we need to add a combination of Bootstrap5 Dropdown classes.

Bootstrap 5  Dropdowns Disabled Attribute: 

  • disabled: This attribute is used to make the dropdown disabled.

Syntax:

<div class="dropdown" ...>
<button class="btn dropdown-toggle"
type="button"
data-bs-toggle="dropdown">
....
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">...</a></li>
<li><a class="dropdown-item disabled"..>...</a></li>
....
</ul>
...
</div>

Example 1: In this example, we set buttons using btn class, the button turned into a dropdown toggle, and disabled the text item in the dropdown.

Output:

Example 2: In this example, we set multiple buttons with a dropdown toggle to show the menu and use disabled class to disable the text in the dropdown.

Output:

Reference: https://getbootstrap.com/docs/5.0/components/dropdowns/#disabled

Comment

Explore