Bootstrap Tabs and Pills

Bootstrap Menus

In HTML, a menu is often defined in an unordered list <ul> (and styled afterwards), like this:

Example -

Bootstrap Tabs

Tabs are created with <ul class="nav nav-tabs">:

Example -

Bootstrap Tabs with Dropdown Menu

You can also use tabs in a dropdown menu.

Example -

Bootstrap Toggleable / Dynamic Tabs

To make the tabs toggleable, add the data-toggle="tab" attribute to each link. Then add a .tab-pane class with a unique ID for every tab and wrap them inside a <div> element with class .tab-content.

Example -

Bootstrap Pills

You can create pills with <ul class="nav nav-pills">. You can also mark the current page with <li class="active">.

Example -

Bootstrap Vertical Pills

Add the .nav-stacked class to display the pills vertically.

Example -

Bootstrap Pills with Dropdown Menu

You can also use dropdown menu with pills.

Example -

Bootstrap Toggleable Dynamic Pills

It is same as toggleable dynamic tabs, the only change is the data-toggle attribute to data-toggle="pill" .

Example -

Nav Menus

Nav menus are navigation menus used in websites. If you want to create a simple horizontal menu in a website, add the .nav class to a <ul> element, followed by .nav-item for each <li> and add the .nav-link class to their links.

Example -

Vertical Nav

Add the .flex-column class to create a vertical nav.

Example -

Justified Tabs/ Pills

For justified tabs/pills, add the .nav-justified class (equal width):

Example -