Navs
Documentation and examples for how to use Bootstrap’s included navigation components. Read the Official Bootstrap Documentation for a full list of instructions and other options.
Basic example
Navigation available in Bootstrap share general markup and styles, from the base .nav
class to the active and disabled states. Swap modifier classes to switch between each style.
<ul class="nav">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
Horizontal alignment
Change the horizontal alignment of your nav with flexbox utilities. By default, navs are left-aligned, but you can easily change them to center or right aligned.
<ul class="nav justify-content-center">
...
</ul>
<ul class="nav justify-content-end">
...
</ul>
Vertical alignment
Stack your navigation by changing the flex item direction with the .flex-column
utility.
<ul class="nav justify-content-center">
...
</ul>
Tabs
Takes the basic nav from above and adds the .nav-tabs
class to generate a tabbed interface.
<ul class="nav nav-tabs">
...
</ul>
Fill and justify
Force your .nav
’s contents to extend the full available width one of two modifier classes. To proportionately fill all available space with your .nav-item
s, use .nav-fill
.
<ul class="nav nav-fill">
...
</ul>
Tabs with dropdowns
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Dropdown</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Separated link</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>