I've been migrating my website over to UIkit 3 instead of Bootstrap 4. But I've been stuck on the navbar for a while. Right now, my navbar is built in Bootstrap 4 and looks like this:
https://jsfiddle.net/eztwL9p7/1/
<nav class="navbar navbar-toggleable-sm sticky-top navbar-light bg-faded">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<a class="navbar-brand">brand</a>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link">Blog <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Projects</a>
</li>
</ul>
<auth-partial>
<ul class="nav navbar-nav">
<li class="nav-item float-xs-right">
<a href="#" class="nav-link">Log in</a>
</li>
</ul>
</auth-partial>
</div>
</nav>
So it's just a normal navbar, but when the page is small enough, a toggle button appears and the items become a drop down list. I've been trying to migrate this to UIKit, but I don't see any option for this in their templates. If I understand it right, it seems like I have to make 2 navbars, one for the normal view and then a smaller one?
The Navbar documentation suggests that the .uk-navbar-toggle
class and the .uk-navbar-toggle-icon
are added like below - resulting in a toggle icon - but without an expandable menu and also not able to hide specified menu items as Bootstrap can do.
<nav class="uk-navbar uk-navbar-container uk-margin">
<div class="uk-navbar-left">
<a class="uk-navbar-toggle" uk-navbar-toggle-icon href="#"></a>
</div>
</nav>
The Navbar documentation recommends that the Off-canvas component (sidebar that slides in and out of the page) - or the Modal component - but neither of these result in a Bootstrap-style toggle menu.
Screenshots that show how the responsive navbar toggle / hide specified elements on smaller screens in Bootstrap:
Screen in normal size - all menu items are shown: