My bootstrap navbar collapses into a dropdown menu on smaller devices, but the default vertical list of items takes up too much space. I am looking to group these items into two columns as shown in this drawing:
https://i.sstatic.net/qZR3j.png
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Item 1</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Item 2</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Item 3</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Item 4</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Item 5</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Item 6</a>
</li>
</ul>
</div>
</div>
</nav>
Check out my CodeSandbox code here
I attempted to group items using
<div class="col-sm-4"> [three items] </div>
, however, it only affected the normal navbar and not the hamburger menu. I couldn't find a solution that applied specifically to hamburgers. I'm open to using JS if necessary, but ideally, I want the standard navbar functionality preserved on larger devices without any modifications - the grouped columns should only appear on the hamburger menu.