![]() |
VOOZH | about |
Bootstrap 5 Dropdowns Single button is used to turn a button into a dropdown toggle with some basic markup. A dropdown button lets the user select from a number of items.
<div class="dropdown">
<button class="btn dropdown-toggle" type="button"
id="gfg" data-bs-toggle="dropdown">
...
</button>
<ul class="dropdown-menu" aria-labelledby="gfg">
...
</ul>
</div>
Example 1: In this example, we set a button using .btn class and button turned into a dropdown toggle.
Output:
Example 2: In this example, we set buttons using .btn class and the button turned into a dropdown toggle. Using dropdown-menu class, a list of items is shown on one click.
Output:
Reference: https://getbootstrap.com/docs/5.0/components/dropdowns/#single-button