Navigation
#
OverviewDocumentation and examples for Bootstrap’s powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.
#
How it worksHere’s what you need to know before getting started with the navbar:
- Navbars require a wrapping .navbar with .navbar-expand{-sm|-md|-lg|-xl|-xxl} for responsive collapsing and color scheme classes.
- Navbars and their contents are fluid by default. Change the container to limit their horizontal width in different ways.
- 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.
- Ensure accessibility by using a
nav>
element or, if using a more generic element such as adiv>
, add a role="navigation" to every navbar to explicitly identify it as a landmark region for users of assistive technologies. - Indicate the current item by using aria-current="page" for the current page or aria-current="true" for the current item in a set.
Here’s an example of all the sub-components included in a responsive light-themed navbar that automatically collapses at the lg (large) breakpoint.
#
Examplesmenümenu brand name
action items
- Web Component
- React
- Angular
<uxf-nav style="position:relative; backgroundColor: gray;"> <section slot="appbar" style="position: relative;"> <div><uxf-icon class="text-danger">face</uxf-icon></div> <h5>menü<uxf-icon class="text-danger">menu</uxf-icon>brand name</h5> <div>action items</div> </section></uxf-nav>
<UxfNav style={{position:'relative',backgroundColor: 'gray'}}> <section slot="appbar" style="position: relative;"> <div><UxfIcon class="text-danger">face</UxfIcon></div> <h5>menü<UxfIcon class="text-danger">menu</UxfIcon>brand name</h5> <div>action items</div> </section></UxfNav>
<uxf-nav style="position:relative; backgroundColor: gray;"> <section slot="appbar" style="position: relative;"> <div><uxf-icon class="text-danger">face</uxf-icon></div> <h5>menü<uxf-icon class="text-danger">menu</uxf-icon>brand name</h5> <div>action items</div> </section></uxf-nav>
Info Message
Headless Accelerator
- Web Component
- React
- Angular
<uxf-nav> <div slot="flash" class="top collapse">
<div class="bg-white p-2 text-s " variant="danger" show> <div class="d-flex align-items-center justify-content-between"> <p class="fw-medium p-0 m-0 text-center">Info Message</p> <uxf-button type="button" variant="link" outline sm chromeless collapse=".top">
<uxf-icon class="text-d">close</uxf-icon> </uxf-button> </div> </div> </div> <uxf-appbar slot="appbar"> <uxf-action-bar slot="left"> <uxf-button type="button" variant="link" outline sm chromeless collapse=".top">
<uxf-icon class="text-white">close</uxf-icon> </uxf-button> <uxf-button variant="light" cta-link outline> <uxf-icon>cloud</uxf-icon> left </uxf-button> <uxf-button variant="light" outline>item</uxf-button> <uxf-button variant="light" outline>left</uxf-button> </uxf-action-bar> <div class="text-center text-uppercase"> Headless Accelerator </div> <uxf-action-bar slot="right" align-right> <uxf-button variant="primary">right</uxf-button> <uxf-button variant="dark">login <uxf-icon class="text-info">person</uxf-icon> </uxf-button> <uxf-button variant="primary">right</uxf-button> </uxf-action-bar> </uxf-appbar> <nav slot="navigation" class="text-white nav d-flex justify-content-between"> <a class="p-2 link-light" href="#">Accelerator online</a> <a class="p-2 link-light" href="#">Catalog</a> <a class="p-2 link-light" href="#">Buy again</a>
<a class="p-2 link-light" href="#">Shopper toolkit</a> <a class="p-2 link-light" href="#">Gift cards</a> <a class="p-2 link-light" href="#">Drugstore & Bodycare</a>
<a class="p-2 link-light" href="#">Sports & Outdoors</a> <a class="p-2 link-light" href="#">Home Improvement</a>
</nav></uxf-nav>
<UxfNav style={{position:'relative',backgroundColor: 'black'}}> <section slot="appbar" style={{position:'relative'}}> <div><UxfIcon class="text-danger">face</UxfIcon></div> <h5>menü<UxfIcon class="text-danger">menu</UxfIcon>brand name</h5> <div>action items</div> </section></UxfNav>
<uxf-nav> <div slot="flash" class="top collapse">
<div class="bg-white p-2 text-s " variant="danger" show> <div class="d-flex align-items-center justify-content-between"> <p class="fw-medium p-0 m-0 text-center">Info Message</p> <uxf-button type="button" variant="link" outline sm chromeless collapse=".top">
<uxf-icon class="text-d">close</uxf-icon> </uxf-button> </div> </div> </div> <uxf-appbar slot="appbar"> <uxf-action-bar slot="left"> <uxf-button type="button" variant="link" outline sm chromeless collapse=".top">
<uxf-icon class="text-white">close</uxf-icon> </uxf-button> <uxf-button variant="light" cta-link outline> <uxf-icon>cloud</uxf-icon> left </uxf-button> <uxf-button variant="light" outline>item</uxf-button> <uxf-button variant="light" outline>left</uxf-button> </uxf-action-bar> <div class="text-center text-uppercase"> Headless Accelerator </div> <uxf-action-bar slot="right" align-right> <uxf-button variant="primary">right</uxf-button> <uxf-button variant="dark">login <uxf-icon class="text-info">person</uxf-icon> </uxf-button> <uxf-button variant="primary">right</uxf-button> </uxf-action-bar> </uxf-appbar> <nav slot="navigation" class="text-white nav d-flex justify-content-between"> <a class="p-2 link-light" href="#">Accelerator online</a> <a class="p-2 link-light" href="#">Catalog</a> <a class="p-2 link-light" href="#">Buy again</a>
<a class="p-2 link-light" href="#">Shopper toolkit</a> <a class="p-2 link-light" href="#">Gift cards</a> <a class="p-2 link-light" href="#">Drugstore & Bodycare</a>
<a class="p-2 link-light" href="#">Sports & Outdoors</a> <a class="p-2 link-light" href="#">Home Improvement</a>
</nav></uxf-nav>
#
Supported contentNavbars come with built-in support for a handful of sub-components.
- Web Component
- React
- Angular
<uxf-nav style="position: relative;"> <nav slot="navigation" class="navbar"> <a class="nav-link" aria-current="page" href="#"> <uxf-icon>home</uxf-icon> </a> <uxf-button variant="light">Navbar</uxf-button> <uxf-button type="button" variant="link">Link</uxf-button> <uxf-dropdown id="dropdownSimple" label="Dropdown" variant="secondary"> <uxf-dropdown-item-header>Dropdown header</uxf-dropdown-item-header> <uxf-dropdown-item><a href="http://google.com/">Go to Google</a></uxf-dropdown-item> <uxf-dropdown-item><a href="http://redhat.com/" class="disabled">Go to RedHat</a></uxf-dropdown-item> <uxf-dropdown-item><a href="http://microsoft.com/" class="active">Go to Microsoft</a></uxf-dropdown-item> <uxf-dropdown-item-divider></uxf-dropdown-item-divider> <uxf-dropdown-item><a href="#">No Link #</a></uxf-dropdown-item> <uxf-dropdown-item><a>No Href</a></uxf-dropdown-item> <uxf-dropdown-item> <button>With text</button> </uxf-dropdown-item> <uxf-dropdown-item> <button>With <b><i>html</i></b> children</button> </uxf-dropdown-item> </uxf-dropdown> <uxf-button variant="light" disabled >Disabled</uxf-button> <form> <input type="search" placeholder="Search" aria-label="Search"></input> <button>Search</button> </form> </nav></uxf-nav>
<UxfNav style={{position:'relative'}}> <nav slot="navigation" class="navbar"> <a class="nav-link" aria-current="page" href="#"> <UxfIcon>home</UxfIcon> </a> <UxfButton variant="light">Navbar</UxfButton> <UxfButton type="button" variant="link">Link</UxfButton> <UxfDropdown id="dropdownSimple" label="Dropdown" variant="secondary"> <UxfDropdownItemHeader>Dropdown header</UxfDropdownItemHeader> <UxfDropdownItem><a href="http://google.com/">Go to Google</a></UxfDropdownItem> <UxfDropdownItem><a href="http://redhat.com/" class="disabled">Go to RedHat</a></UxfDropdownItem> <UxfDropdownItem><a href="http://microsoft.com/" class="active">Go to Microsoft</a></UxfDropdownItem> <UxfDropdownItemDivider></UxfDropdownItemDivider> <UxfDropdownItem><a href="#">No Link #</a></UxfDropdownItem> <UxfDropdownItem><a>No Href</a></UxfDropdownItem> <UxfDropdownItem> <button>With text</button> </UxfDropdownItem> <UxfDropdownItem> <button>With <b><i>html</i></b> children</button> </UxfDropdownItem> </UxfDropdown> <UxfButton variant="light" disabled >Disabled</UxfButton> <form> <input type="search" placeholder="Search" aria-label="Search"></input> <button>Search</button> </form> </nav></UxfNav>
<uxf-nav style="position: relative;"> <nav slot="navigation" class="navbar"> <a class="nav-link" aria-current="page" href="#"> <uxf-icon>home</uxf-icon> </a> <uxf-button variant="light">Navbar</uxf-button> <uxf-button type="button" variant="link">Link</uxf-button> <uxf-dropdown id="dropdownSimple" label="Dropdown" variant="secondary"> <uxf-dropdown-item-header>Dropdown header</uxf-dropdown-item-header> <uxf-dropdown-item><a href="http://google.com/">Go to Google</a></uxf-dropdown-item> <uxf-dropdown-item><a href="http://redhat.com/" class="disabled">Go to RedHat</a></uxf-dropdown-item> <uxf-dropdown-item><a href="http://microsoft.com/" class="active">Go to Microsoft</a></uxf-dropdown-item> <uxf-dropdown-item-divider></uxf-dropdown-item-divider> <uxf-dropdown-item><a href="#">No Link #</a></uxf-dropdown-item> <uxf-dropdown-item><a>No Href</a></uxf-dropdown-item> <uxf-dropdown-item> <button>With text</button> </uxf-dropdown-item> <uxf-dropdown-item> <button>With <b><i>html</i></b> children</button> </uxf-dropdown-item> </uxf-dropdown> <uxf-button variant="light" disabled >Disabled</uxf-button> <form> <input type="search" placeholder="Search" aria-label="Search"></input> <button>Search</button> </form> </nav></uxf-nav>
#
Text- Web Component
- React
- Angular
<uxf-nav style="position: relative;"> <nav slot="navigation" class="navbar navbar-light bg-light"> <a href="#">NavBar</a> </nav></uxf-nav>****
<UxfNav style={{position:'relative'}}> <nav slot="navigation" class="navbar navbar-light bg-light"> <a href="#">NavBar</a> </nav></UxfNav>
<uxf-nav style="position: relative;"> <nav slot="navigation" class="navbar navbar-light bg-light"> <a href="#">NavBar</a> </nav></uxf-nav>****
#
Image- Web Component
- React
- Angular
<uxf-nav style="position: relative;"> <nav slot="navigation" class="navbar"> <a class="nav-link" aria-current="page" href="#"> <uxf-icon>home</uxf-icon></a> </nav></uxf-nav>
<UxfNav style={{position:'relative'}}> <nav slot="navigation" class="navbar"> <a class="nav-link" aria-current="page" href="#"> <UxfIcon>home</UxfIcon></a> </nav></UxfNav>
<uxf-nav style="position: relative;"> <nav slot="navigation" class="navbar"> <a class="nav-link" aria-current="page" href="#"> <uxf-icon>home</uxf-icon></a> </nav></uxf-nav>
#
Image and text- Web Component
- React
- Angular
<uxf-nav style="position: relative;"> <nav slot="navigation" class="navbar"> <a class="nav-link" aria-current="page" href="#"> <uxf-icon>home</uxf-icon></a> <a href="#">Home</a> </nav></uxf-nav>
<UxfNav style={{position:'relative'}}> <nav slot="navigation" class="navbar"> <a class="nav-link" aria-current="page" href="#"> <UxfIcon>home</UxfIcon></a> <a href="#">Home</a> </nav></UxfNav>
<uxf-nav style="position: relative;"> <nav slot="navigation" class="navbar"> <a class="nav-link" aria-current="page" href="#"> <uxf-icon>home</uxf-icon></a> <a href="#">Home</a> </nav></uxf-nav>
#
Nav- Web Component
- React
- Angular
<uxf-nav style="position: relative;"> <nav slot="navigation" class="text-white nav d-flex justify-content-between"> <a class="p-2 link-light" href="#">Accelerator online</a> <a class="p-2 link-light" href="#">Catalog</a> <a class="p-2 link-light" href="#">Buy again</a> <a class="p-2 link-light" href="#">Shopper toolkit</a> <a class="p-2 link-light" href="#">Gift cards</a> <a class="p-2 link-light" href="#">Drugstore & Bodycare</a> <a class="p-2 link-light" href="#">Sports & Outdoors</a> <a class="p-2 link-light" href="#">Home Improvement</a> </nav></uxf-nav>
<UxfNav style={{position:'relative'}}> <nav slot="navigation" class="text-white nav d-flex justify-content-between"> <a class="p-2 link-light" href="#">Accelerator online</a> <a class="p-2 link-light" href="#">Catalog</a> <a class="p-2 link-light" href="#">Buy again</a> <a class="p-2 link-light" href="#">Shopper toolkit</a> <a class="p-2 link-light" href="#">Gift cards</a> <a class="p-2 link-light" href="#">Drugstore & Bodycare</a> <a class="p-2 link-light" href="#">Sports & Outdoors</a> <a class="p-2 link-light" href="#">Home Improvement</a> </nav></UxfNav>
<uxf-nav style="position: relative;"> <nav slot="navigation" class="text-white nav d-flex justify-content-between"> <a class="p-2 link-light" href="#">Accelerator online</a> <a class="p-2 link-light" href="#">Catalog</a> <a class="p-2 link-light" href="#">Buy again</a> <a class="p-2 link-light" href="#">Shopper toolkit</a> <a class="p-2 link-light" href="#">Gift cards</a> <a class="p-2 link-light" href="#">Drugstore & Bodycare</a> <a class="p-2 link-light" href="#">Sports & Outdoors</a> <a class="p-2 link-light" href="#">Home Improvement</a> </nav></uxf-nav>
#
Appbartitle
app title
- Web Component
- React
- Angular
<uxf-appbar> <uxf-action-bar slot="left"> <uxf-button variant="primary" outline> <uxf-icon>cloud</uxf-icon> left </uxf-button> <uxf-button variant="primary" outline>left</uxf-button> </uxf-action-bar>
<h4 class="fw-lighter text-center text-uppercase">title</h4> <uxf-action-bar slot="right" align-right> <uxf-button variant="primary" outline>right</uxf-button> <uxf-button variant="dark">login <uxf-icon class="text-info">person</uxf-icon> </uxf-button> <uxf-button variant="primary" outline>right</uxf-button> </uxf-action-bar></uxf-appbar><hr/><uxf-appbar> <uxf-action-bar slot="left"> <uxf-button variant="primary" chromeless outline> <uxf-icon>arrow_back</uxf-icon> Back </uxf-button> </uxf-action-bar>
<h4 class="fw-lighter text-center text-uppercase">app title</h4> <uxf-action-bar slot="right" align-right> <uxf-button variant="primary" outline chromeless> <uxf-icon>shopping_bag</uxf-icon> </uxf-button> <uxf-button variant="primary" chromeless outline> <uxf-icon>more_vert</uxf-icon> </uxf-button> </uxf-action-bar></uxf-appbar>
<UxfAppbar> <UxfActionBar slot="left"> <UxfButton variant="primary" outline> <UxfIcon>cloud</UxfIcon> left </UxfButton> <UxfButton variant="primary" outline>left</UxfButton> </UxfActionBar> <h4 class="fw-lighter text-center text-uppercase">title</h4> <UxfActionBar slot="right" align-right> <UxfButton variant="primary" outline>right</UxfButton> <UxfButton variant="dark">login <UxfIcon class="text-info">person</UxfIcon> </UxfButton> <UxfButton variant="primary" outline>right</UxfButton> </UxfActionBar></UxfAppbar><hr/><UxfAppbar> <UxfActionBar slot="left"> <UxfButton variant="primary" chromeless outline> <UxfIcon>arrow_back</UxfIcon> Back </UxfButton> </UxfActionBar> <h4 class="fw-lighter text-center text-uppercase">app title</h4> <UxfActionBar slot="right" align-right> <UxfButton variant="primary" outline chromeless> <UxfIcon>shopping_bag</UxfIcon> </UxfButton> <UxfButton variant="primary" chromeless outline> <UxfIcon>more_vert</UxfIcon> </UxfButton> </UxfActionBar></UxfAppbar>
<uxf-appbar> <uxf-action-bar slot="left"> <uxf-button variant="primary" outline> <uxf-icon>cloud</uxf-icon> left </uxf-button> <uxf-button variant="primary" outline>left</uxf-button> </uxf-action-bar>
<h4 class="fw-lighter text-center text-uppercase">title</h4> <uxf-action-bar slot="right" align-right> <uxf-button variant="primary" outline>right</uxf-button> <uxf-button variant="dark">login <uxf-icon class="text-info">person</uxf-icon> </uxf-button> <uxf-button variant="primary" outline>right</uxf-button> </uxf-action-bar></uxf-appbar><hr/><uxf-appbar> <uxf-action-bar slot="left"> <uxf-button variant="primary" chromeless outline> <uxf-icon>arrow_back</uxf-icon> Back </uxf-button> </uxf-action-bar>
<h4 class="fw-lighter text-center text-uppercase">app title</h4> <uxf-action-bar slot="right" align-right> <uxf-button variant="primary" outline chromeless> <uxf-icon>shopping_bag</uxf-icon> </uxf-button> <uxf-button variant="primary" chromeless outline> <uxf-icon>more_vert</uxf-icon> </uxf-button> </uxf-action-bar></uxf-appbar>