Navbars

Use Leaf's custom navbars to create beautiful navigation bars.

Bootstrap 4 documentation
Default navbar
                                                        
<nav class="navbar navbar-expand-lg navbar-transparent navbar-dark navbar-theme-primary mb-4">
    <div class="container position-relative">
        <a class="navbar-brand mr-lg-5" href="#">
            <img class="navbar-brand-dark" src="../../assets/img/brand/light.svg" alt="menuimage">
            <img class="navbar-brand-light" src="../../assets/img/brand/dark.svg" alt="menuimage">
        </a>
        <div class="navbar-collapse collapse" id="navbar-default-primary">
            <div class="navbar-collapse-header">
                <div class="row">
                    <div class="col-6 collapse-brand">
                        <a href="#">
                            <img src="../../assets/img/brand/primary.svg" alt="menuimage">
                        </a>
                    </div>
                    <div class="col-6 collapse-close">
                        <i class="fas fa-times" data-toggle="collapse" role="button"
                            data-target="#navbar-default-primary" aria-controls="navbar-default-primary"
                            aria-expanded="false" aria-label="Toggle navigation"></i>
                    </div>
                </div>
            </div>
            <ul class="navbar-nav navbar-nav-hover align-items-lg-center">
                <li class="nav-item dropdown">
                    <a href="#" class="nav-link" data-toggle="dropdown" role="button">
                        <i class="fas fa-angle-down nav-link-arrow"></i>
                        <span class="nav-link-inner-text">Dropdown 1</span>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a class="dropdown-item" href="#">Dropdown
                                item 1</a></li>
                        <li><a class="dropdown-item" href="#">Dropdown
                                item 2</a></li>
                        <li><a class="dropdown-item" href="#">Dropdown
                                item 3</a></li>
                    </ul>
                </li>
                <li class="nav-item dropdown">
                    <a href="#" class="nav-link" data-toggle="dropdown" role="button">
                        <i class="fas fa-angle-down nav-link-arrow"></i>
                        <span class="nav-link-inner-text">Dropdown 2 </span>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a class="dropdown-item" href="#">Dropdown
                                item 1</a></li>
                        <li><a class="dropdown-item" href="#">Dropdown
                                item 2</a></li>
                        <li><a class="dropdown-item" href="#">Dropdown
                                item 3</a></li>
                    </ul>
                </li>
                <li class="nav-item dropdown">
                    <a href="#" class="nav-link" data-toggle="dropdown" role="button">
                        <i class="fas fa-angle-down nav-link-arrow"></i>
                        <span class="nav-link-inner-text">Dropdown 3</span>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a class="dropdown-item" href="#">Dropdown
                                item 1</a></li>
                        <li><a class="dropdown-item" href="#">Dropdown
                                item 2</a></li>
                        <li><a class="dropdown-item" href="#">Dropdown
                                item 3</a></li>
                    </ul>
                </li>
            </ul>
        </div>
        <div class="d-flex align-items-center">
            <p class="text-white mb-0">Primary navbar</p>
            <button class="navbar-toggler ml-2" type="button" data-toggle="collapse"
                data-target="#navbar-default-primary" aria-controls="navbar-default-primary"
                aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
        </div>
    </div>
</nav>
                                                        
                                                    
Headroom.js

In order to enable headroom for the navbar add the class .headroom to the main .navbar element.

You can update the options of Headroom.js in js/leaf.js.

                                                                
    if ($('.headroom')[0]) {
        var headroom = new Headroom(document.querySelector("#navbar-main"), {
            offset: 0,
            tolerance: {
                up: 0,
                down: 0
            },
        });
        headroom.init();
    }
                                                                
                                                            
Headroom.js documentation