Documentation and examples for Front's 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.
Headers require a wrapping .u-header with behavior behaviors and their classes for responsiveness.
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 a role="navigation" to every navbar to explicitly identify it as a landmark region for users of assistive technologies.
How to use?
Copy-paste the following <script> near the end of your pages under JS Front to enable them.
<headerid="headerBasic"class="u-header"><divclass="u-header__section"><divid="basicLogoAndNav"class="container"><!-- Nav --><navclass="js-mega-menu navbar navbar-expand-md u-header__navbar u-header__navbar--no-space"><!-- Logo --><aclass="navbar-brand u-header__navbar-brand u-header__navbar-brand-center"href="index.html"aria-label="Front"><svgxmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"x="0px"y="0px"width="46px"height="46px"viewBox="0 0 46 46"xml:space="preserve"style="margin-bottom:0;"><pathfill="#3F7DE0"opacity=".65"d="M23,41L23,41c-9.9,0-18-8-18-18v0c0-9.9,8-18,18-18h11.3C38,5,41,8,41,11.7V23C41,32.9,32.9,41,23,41z"/><pathclass="fill-info"opacity=".5"d="M28,35.9L28,35.9c-9.9,0-18-8-18-18v0c0-9.9,8-18,18-18l11.3,0C43,0,46,3,46,6.6V18C46,27.9,38,35.9,28,35.9z"/><pathclass="fill-primary"opacity=".7"d="M18,46L18,46C8,46,0,38,0,28v0c0-9.9,8-18,18-18h11.3c3.7,0,6.6,3,6.6,6.6V28C35.9,38,27.9,46,18,46z"/><pathclass="fill-white"d="M17.4,34V18.3h10.2v2.9h-6.4v3.4h4.8v2.9h-4.8V34H17.4z"/></svg><spanclass="u-header__navbar-brand-text">Front</span></a><!-- End Logo --><!-- Responsive Toggle Button --><buttontype="button"class="navbar-toggler btn u-hamburger"aria-label="Toggle navigation"aria-expanded="false"aria-controls="navBarBasic"data-toggle="collapse"data-target="#navBarBasic"><spanid="hamburgerTriggerBasic"class="u-hamburger__box"><spanclass="u-hamburger__inner"></span></span></button><!-- End Responsive Toggle Button --><!-- Navigation --><divid="navBarBasic"class="collapse navbar-collapse u-header__navbar-collapse"><ulclass="navbar-nav u-header__navbar-nav"><!-- Link --><liclass="nav-item u-header__nav-item"><aclass="nav-link u-header__nav-link"href="#">Link</a></li><!-- End Link --><!-- Link --><liclass="nav-item u-header__nav-item"><aclass="nav-link u-header__nav-link"href="#">Another link</a></li><!-- End Link --><!-- Link --><liclass="nav-item u-header__nav-item"><aclass="nav-link u-header__nav-link"href="#">One more link</a></li><!-- End Link --><!-- Link --><liclass="nav-item u-header__nav-item active"><aclass="nav-link u-header__nav-link"href="#">Active link</a></li><!-- End Link --><!-- Link --><liclass="nav-item u-header__nav-item"><aclass="nav-link u-header__nav-link"href="#">Disabled</a></li><!-- End Link --><!-- Button --><liclass="nav-item u-header__nav-last-item"><aclass="btn btn-sm btn-primary transition-3d-hover"href="https://themes.getbootstrap.com/product/front-multipurpose-responsive-template/"target="_blank">
Buy Now
</a></li><!-- End Button --></ul></div><!-- End Navigation --></nav><!-- End Nav --></div></div></header>
<headerid="headerWithDropdown"class="u-header"><divclass="u-header__section"><divid="logoAndNavWithDropdown"class="container"><!-- Nav --><navclass="js-mega-menu navbar navbar-expand-md u-header__navbar u-header__navbar--no-space"><!-- Logo --><aclass="navbar-brand u-header__navbar-brand u-header__navbar-brand-center"href="index.html"aria-label="Front"><svgxmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"x="0px"y="0px"width="46px"height="46px"viewBox="0 0 46 46"xml:space="preserve"style="margin-bottom:0;"><pathfill="#3F7DE0"opacity=".65"d="M23,41L23,41c-9.9,0-18-8-18-18v0c0-9.9,8-18,18-18h11.3C38,5,41,8,41,11.7V23C41,32.9,32.9,41,23,41z"/><pathclass="fill-info"opacity=".5"d="M28,35.9L28,35.9c-9.9,0-18-8-18-18v0c0-9.9,8-18,18-18l11.3,0C43,0,46,3,46,6.6V18C46,27.9,38,35.9,28,35.9z"/><pathclass="fill-primary"opacity=".7"d="M18,46L18,46C8,46,0,38,0,28v0c0-9.9,8-18,18-18h11.3c3.7,0,6.6,3,6.6,6.6V28C35.9,38,27.9,46,18,46z"/><pathclass="fill-white"d="M17.4,34V18.3h10.2v2.9h-6.4v3.4h4.8v2.9h-4.8V34H17.4z"/></svg><spanclass="u-header__navbar-brand-text">Front</span></a><!-- End Logo --><!-- Responsive Toggle Button --><buttontype="button"class="navbar-toggler btn u-hamburger"aria-label="Toggle navigation"aria-expanded="false"aria-controls="navBarWithDropdown"data-toggle="collapse"data-target="#navBarWithDropdown"><spanid="hamburgerTriggerWithDropdown"class="u-hamburger__box"><spanclass="u-hamburger__inner"></span></span></button><!-- End Responsive Toggle Button --><!-- Navigation --><divid="navBarWithDropdown"class="collapse navbar-collapse u-header__navbar-collapse"><ulclass="navbar-nav u-header__navbar-nav"><!-- Link --><liclass="nav-item u-header__nav-item"><aclass="nav-link u-header__nav-link"href="#">Link</a></li><!-- End Link --><!-- Link --><liclass="nav-item u-header__nav-item"><aclass="nav-link u-header__nav-link"href="#">Another link</a></li><!-- End Link --><!-- Dropdown --><liclass="nav-item hs-has-sub-menu u-header__nav-item"data-event="hover"data-animation-in="slideInUp"data-animation-out="fadeOut"><aid="dropdownMegaMenuWithDropdown"class="nav-link u-header__nav-link u-header__nav-link-toggle"href="javascript:;"aria-haspopup="true"aria-expanded="false"aria-labelledby="dropdownSubMenuWithDropdown">Dropdown</a><!-- Dropdown - Submenu --><ulid="dropdownSubMenuWithDropdown"class="hs-sub-menu u-header__sub-menu u-header__sub-menu--spacer"aria-labelledby="dropdownMegaMenuWithDropdown"style="min-width:230px;"><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">Action</a></li><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">Another action</a></li><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">Something else here</a></li><liclass="dropdown-divider"></li><!-- Submenu --><liclass="hs-has-sub-menu"><aid="navLinkDropdownSubmenuWithDropdown"class="nav-link u-header__sub-menu-nav-link u-header__sub-menu-nav-link-toggle"href="javascript:;"aria-haspopup="true"aria-expanded="false"aria-controls="navSubmenuDropdownSubmenuWithDropdown">Submenu</a><ulid="navSubmenuDropdownSubmenuWithDropdown"class="hs-sub-menu u-header__sub-menu"aria-labelledby="navLinkDropdownSubmenuWithDropdown"style="min-width:200px;"><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">Action</a></li><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">Another action</a></li><liclass="dropdown-divider"></li><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">Something else here</a></li></ul></li><!-- End Submenu --></ul><!-- End Dropdown - Submenu --></li><!-- End Dropdown --><!-- Link --><liclass="nav-item u-header__nav-item active"><aclass="nav-link u-header__nav-link"href="#">Active link</a></li><!-- End Link --><!-- Link --><liclass="nav-item u-header__nav-item"><aclass="nav-link u-header__nav-link"href="#">Disabled</a></li><!-- End Link --><!-- Button --><liclass="nav-item u-header__nav-last-item"><aclass="btn btn-sm btn-primary transition-3d-hover"href="https://themes.getbootstrap.com/product/front-multipurpose-responsive-template/"target="_blank">
Buy Now
</a></li><!-- End Button --></ul></div><!-- End Navigation --></nav><!-- End Nav --></div></div></header>
<headerid="headerWithMegaMenu"class="u-header"><divclass="u-header__section"><divid="logoAndNavWithMegaMenu"class="container"><!-- Nav --><navclass="js-mega-menu navbar navbar-expand-md u-header__navbar u-header__navbar--no-space"><!-- Logo --><aclass="navbar-brand u-header__navbar-brand u-header__navbar-brand-center"href="index.html"aria-label="Front"><svgxmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"x="0px"y="0px"width="46px"height="46px"viewBox="0 0 46 46"xml:space="preserve"style="margin-bottom:0;"><pathfill="#3F7DE0"opacity=".65"d="M23,41L23,41c-9.9,0-18-8-18-18v0c0-9.9,8-18,18-18h11.3C38,5,41,8,41,11.7V23C41,32.9,32.9,41,23,41z"/><pathclass="fill-info"opacity=".5"d="M28,35.9L28,35.9c-9.9,0-18-8-18-18v0c0-9.9,8-18,18-18l11.3,0C43,0,46,3,46,6.6V18C46,27.9,38,35.9,28,35.9z"/><pathclass="fill-primary"opacity=".7"d="M18,46L18,46C8,46,0,38,0,28v0c0-9.9,8-18,18-18h11.3c3.7,0,6.6,3,6.6,6.6V28C35.9,38,27.9,46,18,46z"/><pathclass="fill-white"d="M17.4,34V18.3h10.2v2.9h-6.4v3.4h4.8v2.9h-4.8V34H17.4z"/></svg><spanclass="u-header__navbar-brand-text">Front</span></a><!-- End Logo --><!-- Responsive Toggle Button --><buttontype="button"class="navbar-toggler btn u-hamburger"aria-label="Toggle navigation"aria-expanded="false"aria-controls="navBarWithMegaMenu"data-toggle="collapse"data-target="#navBarWithMegaMenu"><spanid="hamburgerTriggerWithMegaMenu"class="u-hamburger__box"><spanclass="u-hamburger__inner"></span></span></button><!-- End Responsive Toggle Button --><!-- Navigation --><divid="navBarWithMegaMenu"class="collapse navbar-collapse u-header__navbar-collapse"><ulclass="navbar-nav u-header__navbar-nav"><!-- Link --><liclass="nav-item u-header__nav-item"><aclass="nav-link u-header__nav-link"href="#">Link</a></li><!-- End Link --><!-- Link --><liclass="nav-item u-header__nav-item"><aclass="nav-link u-header__nav-link"href="#">Another link</a></li><!-- End Link --><!-- Nav Item --><liclass="nav-item hs-has-mega-menu u-header__nav-item"data-event="hover"data-animation-in="slideInUp"data-animation-out="fadeOut"data-position="left"><aid="linkMegaMenuWithMegaMenu"class="nav-link u-header__nav-link u-header__nav-link-toggle"href="javascript:;"aria-haspopup="true"aria-expanded="false">Basic mega menu</a><!-- Nav Item - Mega Menu --><divclass="hs-mega-menu w-100 u-header__sub-menu"aria-labelledby="linkMegaMenuWithMegaMenu"><divclass="row u-header__mega-menu-wrapper"><divclass="col-sm-3 mb-3 mb-sm-0"><spanclass="u-header__sub-menu-title">One</span><ulclass="u-header__sub-menu-nav-group mb-3"><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">One</a></li><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">Two</a></li><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">Three</a></li></ul></div><divclass="col-sm-3 mb-3 mb-sm-0"><spanclass="u-header__sub-menu-title">Two</span><ulclass="u-header__sub-menu-nav-group"><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">One</a></li><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">Two</a></li><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">Three</a></li></ul></div><divclass="col-sm-3 mb-3 mb-sm-0"><spanclass="u-header__sub-menu-title">Three</span><ulclass="u-header__sub-menu-nav-group mb-3"><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">One</a></li><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">Two</a></li></ul></div><divclass="col-sm-3"><spanclass="u-header__sub-menu-title">Four</span><ulclass="u-header__sub-menu-nav-group mb-3"><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">One</a></li><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">Two</a></li><li><aclass="nav-link u-header__sub-menu-nav-link"href="#">Three</a></li></ul></div></div></div><!-- End Nav Item - Mega Menu --></li><!-- End Nav Item --><!-- Link --><liclass="nav-item u-header__nav-item active"><aclass="nav-link u-header__nav-link"href="#">Active link</a></li><!-- End Link --><!-- Link --><liclass="nav-item u-header__nav-item"><aclass="nav-link u-header__nav-link disabled"href="#">Disabled</a></li><!-- End Link --><!-- Button --><liclass="nav-item u-header__nav-last-item"><aclass="btn btn-sm btn-primary transition-3d-hover"href="https://themes.getbootstrap.com/product/front-multipurpose-responsive-template/"target="_blank">
Buy Now
</a></li><!-- End Button --></ul></div><!-- End Navigation --></nav><!-- End Nav --></div></div></header>
<headerid="headerLogoOnTop"class="u-header u-header-center-aligned-nav u-header--center-aligned-md"><divclass="u-header__section"><divid="logoOnTopLogoAndNav"class="container"><divclass="u-header--center-aligned__inner"><!-- Logo --><aclass="navbar-brand u-header__navbar-brand u-header__navbar-brand-center"href="index.html"aria-label="Front"><svgxmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"x="0px"y="0px"width="46px"height="46px"viewBox="0 0 46 46"xml:space="preserve"style="margin-bottom:0;"><pathfill="#3F7DE0"opacity=".65"d="M23,41L23,41c-9.9,0-18-8-18-18v0c0-9.9,8-18,18-18h11.3C38,5,41,8,41,11.7V23C41,32.9,32.9,41,23,41z"/><pathclass="fill-info"opacity=".5"d="M28,35.9L28,35.9c-9.9,0-18-8-18-18v0c0-9.9,8-18,18-18l11.3,0C43,0,46,3,46,6.6V18C46,27.9,38,35.9,28,35.9z"/><pathclass="fill-primary"opacity=".7"d="M18,46L18,46C8,46,0,38,0,28v0c0-9.9,8-18,18-18h11.3c3.7,0,6.6,3,6.6,6.6V28C35.9,38,27.9,46,18,46z"/><pathclass="fill-white"d="M17.4,34V18.3h10.2v2.9h-6.4v3.4h4.8v2.9h-4.8V34H17.4z"/></svg><spanclass="u-header__navbar-brand-text">Front</span></a><!-- End Logo --><!-- Responsive Toggle Button --><buttontype="button"class="navbar-toggler btn u-hamburger"aria-label="Toggle navigation"aria-expanded="false"aria-controls="navBarLogoOnTop"data-toggle="collapse"data-target="#navBarLogoOnTop"><spanid="hamburgerTriggerLogoOnTop"class="u-hamburger__box"><spanclass="u-hamburger__inner"></span></span></button><!-- End Responsive Toggle Button --></div><!-- Nav --><navclass="js-mega-menu navbar navbar-expand-md u-header__navbar u-header__navbar--no-space"><!-- Navigation --><divid="navBarLogoOnTop"class="collapse navbar-collapse u-header__navbar-collapse"><ulclass="navbar-nav u-header__navbar-nav"><!-- Link --><liclass="nav-item u-header__nav-item"><aclass="nav-link u-header__nav-link"href="#">Link</a></li><!-- End Link --><!-- Link --><liclass="nav-item u-header__nav-item"><aclass="nav-link u-header__nav-link"href="#">Another link</a></li><!-- End Link --><!-- Link --><liclass="nav-item u-header__nav-item"><aclass="nav-link u-header__nav-link"href="#">One more link</a></li><!-- End Link --><!-- Link --><liclass="nav-item u-header__nav-item active"><aclass="nav-link u-header__nav-link"href="#">Active link</a></li><!-- End Link --><!-- Link --><liclass="nav-item u-header__nav-item"><aclass="nav-link u-header__nav-link disabled"href="#">Disabled</a></li><!-- End Link --><!-- Button --><liclass="nav-item u-header__nav-last-item"><aclass="btn btn-sm btn-primary transition-3d-hover"href="https://themes.getbootstrap.com/product/front-multipurpose-responsive-template/"target="_blank">
Buy Now
</a></li><!-- End Button --></ul></div><!-- End Navigation --></nav><!-- End Nav --></div></div></header>
The .navbar-brand can be applied to most elements, but an anchor works best as some elements might require utility classes or custom styles. For example, this example demonstrates a navbar-brand with SVG logo:
<headerid="headerBrand"class="u-header"><divclass="u-header__section"><divid="brandLogoAndNav"class="container"><!-- Nav --><navclass="navbar navbar-expand-md u-header__navbar"><!-- Logo --><aclass="navbar-brand u-header__navbar-brand u-header__navbar-brand-center"href="index.html"aria-label="Front"><svgxmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"x="0px"y="0px"width="46px"height="46px"viewBox="0 0 46 46"xml:space="preserve"style="margin-bottom:0;"><pathfill="#3F7DE0"opacity=".65"d="M23,41L23,41c-9.9,0-18-8-18-18v0c0-9.9,8-18,18-18h11.3C38,5,41,8,41,11.7V23C41,32.9,32.9,41,23,41z"/><pathclass="fill-info"opacity=".5"d="M28,35.9L28,35.9c-9.9,0-18-8-18-18v0c0-9.9,8-18,18-18l11.3,0C43,0,46,3,46,6.6V18C46,27.9,38,35.9,28,35.9z"/><pathclass="fill-primary"opacity=".7"d="M18,46L18,46C8,46,0,38,0,28v0c0-9.9,8-18,18-18h11.3c3.7,0,6.6,3,6.6,6.6V28C35.9,38,27.9,46,18,46z"/><pathclass="fill-white"d="M17.4,34V18.3h10.2v2.9h-6.4v3.4h4.8v2.9h-4.8V34H17.4z"/></svg><spanclass="u-header__navbar-brand-text">Front</span></a><!-- End Logo --></nav><!-- End Nav --></div></div></header>
<headerid="headerBrand"class="u-header"><divclass="u-header__section"><divid="brandLogoAndNav"class="container"><!-- Nav --><navclass="navbar navbar-expand-md u-header__navbar"><!-- Logo --><aclass="navbar-brand u-header__navbar-brand u-header__navbar-brand-center"href="index.html"aria-label="Front"><imgsrc="../../assets/img/logos/front-logo.png"alt="Image Description"></a><!-- End Logo --></nav><!-- End Nav --></div></div></header>
You have too many links to fit into a single navbar? Or you do not want your menu to collapse at all? Front offers navbar scroll option that horizontally scrolls the navbar links.
With our Scroll nav plguin, it is now easy to convert links into scrollable nav.
Wrap the links in a parent element with an ID or class and add the same ID or the class in the JS init function of the hs.scroll-nav.js plugin, add #section-name to the href element you want to be scrolled to a certain content.
Theming the navbar has never been easier thanks to the combination of theming classes and background-color utilities. Apply the parent .u-header--navbar-bg class next to .u-header class, choose from .bg-primary for use with primary background colors, or .bg-dark for dark background colors. Then, customize with .bg-* utilities.
Add a .u-header--bg-transparent class to a parent element (must come before .u-header__section class), also you can use .u-header--white-nav-links{-sm|-md|-lg|-xl} white color nav links class for clear displaying the links.
Transparent .u-header--bg-transparent{-sm|-md|-lg|-xl} classes are also available for responsive breakpoints.
Use our placement-classes 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.
<headerid="headerPlacementAbsTop2ndScreen"class="u-header u-header--abs-top-2nd-screen"><aclass="navbar-brand"href="#">Absolute top second screen</a></header>
Placement classes can utilize .u-header--*{-sm|-md|-lg|-xl}. Learn more placement 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.
JavaScript behavior
Methods
Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-header-fix-moment="".
Attribute
Description
data-header-fix-moment
Changes navbar behavior at the time specified by the user.
data-header-fix-effect
Show/hide effect of an element. Available options:
slide
fade
show-hide
data-header-fix-exclude
All the listed classes in this attribute will be removed from the section at the time of commit.
data-header-fix-classes
All the listed classes in this attribute will be added to the section at the time of the commit.
data-effect-compensation
Defines if the data-effect-compensation-* attributes should be enabled.
data-effect-compensation-start-class
Points to the class that will be replaced with specified class in the data-effect-compensation-end-class.
data-effect-compensation-end-class
Points to the class that will be replaced with specified class in data-effect-compensation-start-class, at the value of scroll specified in the data-header-fix-moment.
Placement classes
List of available classes and their descriptions.
Class
Description
u-header--static-{media-type}
Static type, behaves as with the rule position: static;. Its geometry is taken into account when rendering a page.
u-header--abs-top-{media-type}
Practically the same as static, but the geometry of this type of header is not taken into account when rendering the page (because of position: absolute;). This type of header is well suited for transparent/half-transparent header designs that are displayed on top of the slider/hero/etc. Its geometry is taken into account when rendering a page.
u-header--abs-top-2nd-screen-{media-type}
This type of header works when we have the first section on the page that has a height: 100vh;, i.e. fullscreen. It is displayed as adhering to the top of the second section in the stream on the page. The geometry of this header is also excluded from the calculation of the positioning of all elements on the page.
u-header--abs-bottom-{media-type}
The same as u-header--abs-top, only the header is displayed as sticking to the bottom of the first section in the stream.
u-header--sticky-top-{media-type}
It is displayed as sticking to the top of the screen always (position: fixed; top: 0;). The geometry of this header is also excluded from the calculation of the positioning of all elements on the page.
u-header--sticky-bottom-{media-type}
It is displayed as always (position: fixed; bottom: 0;) adhered to the top of the screen. The geometry of this header is also excluded from the calculation of the positioning of all elements on the page.
Behaviors
List of available classes and their descriptions.
Class
Description
u-header--show-hide-{media-type}
Show/hide an item when scrolling to the user specified time. This moment is given in the form of the number of scrolled pixels, through the attribute data-header-fix-moment="". There are 3 available options for how to show/hide an element using the data-header-fix-effect="" attribute:
slide
fade
show-hide
u-header--change-logo-{media-type}
Changes the logo at the time specified by the user. This moment is given in the form of the number of scrolled pixels, through the attribute data-header-fix-moment="". The markup of the logo is important, and should look like this:
Changes the appearance of the sections at the time specified by the user. This moment is given in the form of the number of scrolled pixels, through the attribute data-header-fix-moment="". You can control the appearance of each section with 2 attributes:
data-header-fix-moment-exclude="" - all the listed classes in this attribute will be removed from the section at the time of commit.
data-header-fix-moment-classes="" - all the listed classes in this attribute will be added to the section at the time of the commit.
This approach allows you to manage styles without !important CSS parameter.
For example:
In this case, to change the section from gray to dark, we remove u-header__section--light bg-secondary (which by default is on this element) and add u-header__section--primary bg-primary.
u-header--toggle-section-{media-type}
Show/hide one of the header sections (preferably the very first) at the user specified time. This moment is specified as the number of scrolled pixels, through the attribute data-header-fix-moment="". For this, the section itself needs to be given the class .u-header__section--hidden.
u-header--invulnerable-{media-type}
This class is auxiliary and is used to reset the previous behavior (with the previous permission, if the user has changed the window size) on a certain viewport. For example, if the user wants to open/show a section on -xs, -sm, but not higher. (Because Front alike Bootstrap is developed mobile first, a strategy in which we optimize code for mobile devices first and then scale up components as necessary using CSS media queries.), having set -sm it will work and on permissions above, in order to prevent it use this class. For example:
here the behavior of toggle-section will work until the resolution is -md (that is, xs, sm), on viewport -md it will not work.
A certain behavior is tied to a specific position
Because of the complexity of the task itself with behaviors and positions, a certain behavior is tied to a specific position. That is, if you want the above -lg to work show-hide, you need to specify 2 classes.