Navbar
Documentation and examples for Fury powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.
How it works
Here’s what you need to know before getting started with the navbar:
- Navbars require a wrapping
.navbar
with.navbar-expand{-sm|-md|-lg|-xl}
for responsive collapsing and color scheme classes. - Navbars and their contents are fluid by default. Use optional containers to limit their horizontal width.
- Use our spacing and flex utility classes for controlling spacing and alignment within navbars.
- Navbars are responsive by default, but you can easily modify them to change that. Responsive behavior depends on our Collapse JavaScript plugin.
- Navbars are hidden by default when printing. Force them to be printed by adding
.d-print
to the.navbar
. See the display utility class. - Ensure accessibility by using a
<nav>
element or, if using a more generic element such as a<div>
, add arole="navigation"
to every navbar to explicitly identify it as a landmark region for users of assistive technologies.
Supported content
Navbars come with built-in support for a handful of sub-components. Choose from the following as needed:
.navbar-brand
for your company, product, or project name..navbar-nav
for a full-height and lightweight navigation (including support for dropdowns)..navbar-toggler
for use with our collapse plugin and other navigation toggling behaviors..form-inline
for any form controls and actions..navbar-text
for adding vertically centered strings of text..collapse.navbar-collapse
for grouping and hiding navbar contents by a parent breakpoint.
Basic example
<header class="site-header bg-white">
<nav class="site-navbar container">
<div class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand font-weight-bold text-dark" href="index.html">
Brand
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#basicNavbar" aria-controls="basicNavbar" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon navbar-toggler-dark"></span>
</button>
<div class="navbar-collapse collapse" id="basicNavbar">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact Us</a>
</li>
<li class="nav-item ml-lg-4">
<a href="#" class="btn btn-primary btn-sm hover-translate"> Buy Now</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
Navbar with dropdown
Fury dropdown come with simple and powerful features. it also support nested dropdown .you may also
utilize dropdowns in your navbar nav. Dropdown menus require a wrapping element for
positioning, so be sure to use separate and nested elements for .nav-item
and .nav-link
as
shown below.
<div class="dropup">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">
Another action
</a>
<a class="dropdown-item" href="#">
Something else here
</a>
<a class="dropdown-item" href="#">
Anything else
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">
Cool, Support Divider
</a>
</div>
</div>
Navbar with mega menu
Trigger dropdown menus on hover by adding data-dropdown-event="hover"
to the
parent element. dropdown also support any content
<div class="dropdown" data-dropdown-event="hover">
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Dropdown Hover
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
<a class="dropdown-item" href="#">Anything else</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Cool, Support Divider</a>
</div>
</div>
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Dropdown Content
</button>
<div class="dropdown-menu">
<form class="px-4 py-3">
<div class="form-group">
<label for="exampleDropdownFormEmail1">Email address</label>
<input type="email" class="form-control" id="exampleDropdownFormEmail1"
placeholder="email@example.com">
</div>
<div class="form-group">
<label for="exampleDropdownFormPassword1">Password</label>
<input type="password" class="form-control" id="exampleDropdownFormPassword1"
placeholder="Password">
</div>
<div class="form-group">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="dropdownCheck">
<label class="form-check-label" for="dropdownCheck">
Remember me
</label>
</div>
</div>
<button type="submit" class="btn btn-primary">Sign in</button>
</form>
</div>
</div>
<div class="dropdown" style="width: 300px">
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Dropdown Large
</button>
<div class="dropdown-menu">
<div class="p-4">
<h6>
Hello from dropdown <i class="far fa-smile text-primary"></i>
</h6>
<p class="mb-0">
Nunc placerat mi id nisi interdm they mtolis. Praesient is haretra justo ught scel
erisque placer.
</p>
</div>
</div>
</div>
Navbar alignment
By default, navbars are right aligned. with the help of flexbox utility classes you can align them as
you want. to please it to left add class .ml-auto
here are some demo:
<div class="dropup">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">
Another action
</a>
<a class="dropdown-item" href="#">
Something else here
</a>
<a class="dropdown-item" href="#">
Anything else
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">
Cool, Support Divider
</a>
</div>
</div>
By adding class .mx-auto
to the .navbar-nav
you can make navbar place in
center.
<div class="dropup">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">
Another action
</a>
<a class="dropdown-item" href="#">
Something else here
</a>
<a class="dropdown-item" href="#">
Anything else
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">
Cool, Support Divider
</a>
</div>
</div>
With the help of Bootstrap flexbox utility you can pleace .navbar-brand
in center. here is
the trick
<div class="dropup">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">
Another action
</a>
<a class="dropdown-item" href="#">
Something else here
</a>
<a class="dropdown-item" href="#">
Anything else
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">
Cool, Support Divider
</a>
</div>
</div>
Color schemes
Theming the navbar has never been easier thanks to the combination of theming classes and background-color
utilities. Choose from .navbar-light
for use with light background colors, or .navbar-dark
for dark background colors. Then, customize with .bg-*
utilities.
Placement
Use our position utilities to place navbars in non-static
positions. Choose from fixed to the top, fixed to the bottom, or stickied to the top (scrolls with the
page until it reaches the top, then stays there). Fixed navbars use position: fixed
, meaning they’re pulled from the normal flow of the
DOM and may require custom CSS (e.g., padding-top
on the <body>
) to prevent overlap with other elements.
Also note that .sticky-top
uses position: sticky
, which isn’t fully supported in every browser.
Responsive behaviors
Navbars can utilize .navbar-toggler
, .navbar-collapse
, and .navbar-expand{-sm|-md|-lg|-xl}
classes to change when their content
collapses behind a button. In combination with other utilities, you can easily choose when to show or
hide particular elements.
For navbars that never collapse, add the .navbar-expand
class on
the navbar. For navbars that always collapse, don’t add any .navbar-expand
class.
On scroll behaviors
Example of navbar and change navbar appearance when scroll.
Class | Description |
---|---|
data-header-fix-moment
|
Changes navbar behavior at the time specified by the user. |
data-header-fix-moment
|
Changes navbar behavior at the time specified by the user. |
data-header-fix-moment
|
Changes navbar behavior at the time specified by the user. |