loading

BS5 Navs

Bootstrap 5 Navs

Link   Link   Link   Disabled

Add the .nav class to a <ul> element, then the .nav-item class for each <li>, and lastly the .nav-link class to their links if you want to make a straightforward horizontal menu:

Example

				
					<ul class="nav">
  <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" href="#">Link</a>
  </li>
  <li class="nav-item">
    <a class="nav-link disabled" href="#">Disabled</a>
  </li>
</ul>
				
			

Aligned Nav

Link   Link   Link   Disabled

Link   Link   Link   Disabled

To center the navigation, use the .justify-content-center class; to right-align the navigation, add the .justify-content-end class.

Example

				
					<!-- Centered nav -->
<ul class="nav justify-content-center">

<!-- Right-aligned nav -->
<ul class="nav justify-content-end">
				
			

Vertical Nav

Link   

Link   

Link   

Disabled

To make a vertical navigation, add the .flex-column class:

Example

				
					<ul class="nav flex-column">
				
			

Tabs

Bs5 Navs -

Use the .nav-tabs class to transform the nav menu into navigation tabs. To the active/current link, add the .active class. See the last example on this page if you would like the tabs to be able to be toggled.

Example

				
					<ul class="nav nav-tabs">
  <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="#">Disabled</a>
  </li>
</ul>
				
			

Pills

Bs5 Navs -

Use the .nav-pills class to transform the nav menu into navigation pills. See the last example on this page if you want the pills to be able to be toggled.

Example

				
					<ul class="nav nav-pills">
  <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="#">Disabled</a>
  </li>
</ul>
				
			

Justified Tabs/pills

Apply the .nav-justified class (equal width) to the tabs and pills to justify them:

Bs5 Navs -

Example

				
					<ul class="nav nav-pills nav-justified">..</ul>
<ul class="nav nav-tabs nav-justified">..</ul>
				
			

Pills with Dropdown

==== Dropdown MUKAVU ====

Example

				
					<ul class="nav nav-pills">
  <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-toggle="dropdown" href="#">Dropdown</a>
    <div class="dropdown-menu">
      <a class="dropdown-item" href="#">Link 1</a>
      <a class="dropdown-item" href="#">Link 2</a>
      <a class="dropdown-item" href="#">Link 3</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="#">Disabled</a>
  </li>
</ul>
				
			

Tabs with Dropdown

==== Dropdown MUKAVU ====

Example

				
					<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-toggle="dropdown" href="#">Dropdown</a>
    <div class="dropdown-menu">
      <a class="dropdown-item" href="#">Link 1</a>
      <a class="dropdown-item" href="#">Link 2</a>
      <a class="dropdown-item" href="#">Link 3</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="#">Disabled</a>
  </li>
</ul>
				
			

Toggleable / Dynamic Tabs

==== Dropdown MUKAVU ====

Give each link the data-toggle=”tab” attribute to enable tab switching. Next, give each tab a distinct ID by adding a .tab-pane class, and enclose them in a <div> element with the class .tab-content.

Add the .fade class to the .tab-pane if you want the tabs to fade in and out when a user clicks on them:

Example

				
					<!-- Nav tabs -->
<ul class="nav nav-tabs">
  <li class="nav-item">
    <a class="nav-link active" data-toggle="tab" href="#home">Home</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" data-toggle="tab" href="#menu1">Menu 1</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" data-toggle="tab" href="#menu2">Menu 2</a>
  </li>
</ul>

<!-- Tab panes -->
<div class="tab-content">
  <div class="tab-pane container active" id="home">...</div>
  <div class="tab-pane container fade" id="menu1">...</div>
  <div class="tab-pane container fade" id="menu2">...</div>
</div>
				
			

Toggleable / Dynamic Pills

==== Dropdown MUKAVU ====

For pills, the code is the same; simply set the data-toggle property to data-toggle=”pill”:

Example

				
					<!-- Nav pills -->
<ul class="nav nav-pills">
  <li class="nav-item">
    <a class="nav-link active" data-toggle="pill" href="#home">Home</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" data-toggle="pill" href="#menu1">Menu 1</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" data-toggle="pill" href="#menu2">Menu 2</a>
  </li>
</ul>

<!-- Tab panes -->
<div class="tab-content">
  <div class="tab-pane container active" id="home">...</div>
  <div class="tab-pane container fade" id="menu1">...</div>
  <div class="tab-pane container fade" id="menu2">...</div>
				
			
Share this Doc

BS5 Navs

Or copy link

Explore Topic