Dropdowns
Toggle contextual overlays for displaying lists of links and more with the Bootstrap dropdown plugin.
Dropdown Defaults
<div class="dropdown"><!-- Dropdown : Button -->
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
Button
</button>
<ul class="dropdown-menu shadow-lg p-3" aria-labelledby="dropdownMenuButton">
<li>
<a class="dropdown-item rounded" href="#">
<span>Option 1</span>
</a>
</li>
<li>
<a class="dropdown-item rounded" href="#">
<span>Option 2</span>
</a>
</li>
<li class="dropdown-divider"></li>
<li>
<a class="dropdown-item rounded" href="#">
<span>Option 3</span>
</a>
</li>
</ul>
</div>
<div class="dropdown"><!-- Dropdown : Link -->
<a class="btn btn-primary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">
Link
</a>
<ul class="dropdown-menu shadow-lg p-3" aria-labelledby="dropdownMenuLink">
<li>
<a class="dropdown-item rounded" href="#">
<span>Option 1</span>
</a>
</li>
<li>
<a class="dropdown-item rounded" href="#">
<span>Option 2</span>
</a>
</li>
<li class="dropdown-divider"></li>
<li>
<a class="dropdown-item rounded" href="#">
<span>Option 3</span>
</a>
</li>
</ul>
</div>
<div class="dropdown"><!-- Dropdown : Dark -->
<a class="btn btn-dark dropdown-toggle" href="#" role="button" id="dropdownMenuDark" data-bs-toggle="dropdown" aria-expanded="false">
Dark
</a>
<ul class="dropdown-menu dropdown-menu-dark shadow-lg p-3" aria-labelledby="dropdownMenuDark">
<li>
<a class="dropdown-item rounded" href="#">
<span>Option 1</span>
</a>
</li>
<li>
<a class="dropdown-item rounded" href="#">
<span>Option 2</span>
</a>
</li>
<li class="dropdown-divider"></li>
<li>
<a class="dropdown-item rounded" href="#">
<span>Option 3</span>
</a>
</li>
</ul>
</div>
Dropdown Position
<!--
Positioning Classes
.dropdown
.dropup
.dropstart
.dropend
Optional offset example
data-bs-offset="0,6"
-->
<div class="dropdown">
<a class="btn btn-warning dropdown-toggle" href="#" role="button" id="dropdownMenuPos1" data-bs-toggle="dropdown" aria-expanded="false" data-bs-offset="0,0">
Dropdown
</a>
<ul class="dropdown-menu shadow-lg p-3" aria-labelledby="dropdownMenuPos1">
<li>
<a class="dropdown-item rounded" href="#">
<span>Option 1</span>
</a>
</li>
<li>
<a class="dropdown-item rounded" href="#">
<span>Option 2</span>
</a>
</li>
<li class="dropdown-divider"></li>
<li>
<a class="dropdown-item rounded" href="#">
<span>Option 3</span>
</a>
</li>
</ul>
</div>
Dropdown Clickable
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<div class="dropdown"><!-- Dropdown : Clickable -->
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenuClickable" data-bs-toggle="dropdown" aria-expanded="false">
Button
</button>
<div class="dropdown-menu dropdown-clickable shadow-lg p-3" aria-labelledby="dropdownMenuClickable">
...
</div>
</div>
Dropdown Form
<form method="get" class="dropdown">
<input type="text" class="dropdown-toggle form-control" data-bs-toggle="dropdown" placeholder="Product title / SKU">
<div class="dropdown-menu dropdown-clickable animate-fadein shadow-lg p-4">
<h6 class="mb-4">Filter products</h6>
<div class="row g-3">
<div class="col-md-6">
<div class="form-floating mb-3">
<select class="form-select" id="filter-category" aria-label="Category">
<option value="" selected>Any</option>
<option value="1">Shoes</option>
<option value="2">Men tshirt</option>
<option value="3">Women thisrt</option>
</select>
<label for="filter-category">Category</label>
</div>
</div>
<div class="col-md-6">
<div class="form-floating mb-3">
<select class="form-select" id="filter-brand" aria-label="Brand">
<option value="" selected>Any</option>
<option value="1">Nike</option>
<option value="2">Adidas</option>
<option value="3">Loreal</option>
</select>
<label for="filter-brand">Brand</label>
</div>
</div>
</div>
<div class="form-check d-block d-sm-inline-block me-2 mb-2">
<input class="form-check-input form-check-input-primary" type="checkbox" value="1" id="filter-saleprice">
<label class="form-check-label user-select-none" for="filter-saleprice">
Sale price
</label>
</div>
<div class="form-check d-block d-sm-inline-block me-2 mb-2">
<input class="form-check-input form-check-input-primary" type="checkbox" value="1" id="filter-preorder">
<label class="form-check-label user-select-none" for="filter-preorder">
Allow preorders
</label>
</div>
<div class="d-flex justify-content-between pt-2">
<button type="submit" class="btn btn-sm btn-primary">Apply filter</button>
<a href="#!" class="btn btn-sm btn-danger btn-soft float-end">Reset</a>
</div>
</div>
</form>
Dropdown Full
Nothing special, just a full copy of the above dropdown used as demo (svg icons, etc).
<div class="dropdown">
<a class="btn btn-warning dropdown-toggle" href="#" role="button" id="dropdownMenuFull" data-bs-toggle="dropdown" aria-expanded="false" data-bs-offset="0,6">
Dropdown
<span class="group-switch">
<svg xmlns="http://www.w3.org/2000/svg" width="18px" height="18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="18px" height="18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</span>
</a>
<ul class="dropdown-menu shadow-lg p-3" aria-labelledby="dropdownMenuFull">
<li>
<a class="dropdown-item rounded" href="#">
<svg class="text-gray-600" xmlns="http://www.w3.org/2000/svg" width="18px" height="18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
<span>Add Item</span>
</a>
</li>
<li>
<a class="dropdown-item rounded" href="#">
<svg class="text-gray-600" xmlns="http://www.w3.org/2000/svg" width="18px" height="18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
<span>Set active</span>
</a>
</li>
<li>
<a class="dropdown-item rounded" href="#">
<svg class="text-gray-600" xmlns="http://www.w3.org/2000/svg" width="18px" height="18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
<span>Set inactive</span>
</a>
</li>
<li>
<a class="dropdown-item rounded" href="#">
<svg class="text-gray-600" xmlns="http://www.w3.org/2000/svg" width="18px" height="18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 20h9"></path>
<path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path>
</svg>
<span>Edit</span>
</a>
</li>
<li>
<a class="dropdown-item rounded" href="#">
<svg class="text-gray-600" xmlns="http://www.w3.org/2000/svg" width="18px" height="18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<ellipse cx="12" cy="5" rx="9" ry="3"></ellipse>
<path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"></path>
<path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"></path>
</svg>
<span>Archive</span>
</a>
</li>
<li>
<a class="dropdown-item rounded" href="#">
<svg class="text-gray-600" xmlns="http://www.w3.org/2000/svg" width="18px" height="18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
<span>Some option</span>
</a>
</li>
<li class="dropdown-divider"></li>
<li>
<a class="dropdown-item rounded" href="#">
<svg class="text-gray-600" xmlns="http://www.w3.org/2000/svg" width="18px" height="18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="3 6 5 6 21 6"></polyline>
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
<line x1="10" y1="11" x2="10" y2="17"></line>
<line x1="14" y1="11" x2="14" y2="17"></line>
</svg>
<span class="w-100">Delete</span>
<span class="badge bg-gray-500 rounded-pill float-end">3</span>
</a>
</li>
</ul>
</div>