Light navbar
Light navbar is a basic Bootstrap navbar with whitebackground color defined in $navbar-light-bgvariable. Light navbar is the only navbar style that has light color scheme. By default, basic Bootstrap styling has only 2 color presets: lightand dark. To use light navbar styling, add .navbar-lightclass to the base .navbarcontainer, styles of all navbar components will be adjusted to the light background theme automatically.
Light navbar example:
Light navbar markup:
<!-- Light navbar --><div class="navbar navbar-light navbar-expand-md"> <!-- Header --> <div class="navbar-header navbar-dark [...]"> <div class="navbar-brand navbar-brand-md"> ... </div> <div class="navbar-brand navbar-brand-xs"> ... </div> </div> <!-- /header --> <!-- Mobile toggler --> <div class="d-md-none"> ... </div> <!-- /mobile toggler --> <!-- Navbar content --> <div class="collapse navbar-collapse" id="navbar-main"> ... </div> <!-- /navbar content --></div><!-- /light navbar -->
Dark navbar
Dark navbar is one of the default Bootstrap navbar styles with darkblue/grey background color defined in $navbar-dark-bgvariable. Default BS styling requires color helper class added to .navbar-darkcontainer. This behaviour was improved and all .bg-[color]classes are now optional, but still require .navbar-darkclass for proper content styling. Some elements require minor color adjustments (link and border colors), so use utility classes to make them pixel perfect.
Dark navbar example:
Dark navbar markup:
<!-- Dark navbar --><div class="navbar navbar-dark navbar-expand-md"> <!-- Header --> <div class="navbar-header navbar-dark [...]"> <div class="navbar-brand navbar-brand-md"> ... </div> <div class="navbar-brand navbar-brand-xs"> ... </div> </div> <!-- /header --> <!-- Mobile toggler --> <div class="d-md-none"> ... </div> <!-- /mobile toggler --> <!-- Navbar content --> <div class="collapse navbar-collapse" id="navbar-main"> ... </div> <!-- /navbar content --></div><!-- /dark navbar -->
Custom navbar color
Both light and dark navbars support custom background colors from template's color systemand default BS color options. For darkcolors use .bg-[color]and/or .bg-[color]-[tone]classes, for lightcolors use .bg-lightand .alpha-[color]classes. All components inside navbar automatically adjust text, placeholder and background colors according to the specified color theme.
Custom light color example:
Custom dark color example:
Custom light color markup:
<!-- Custom light color --><div class="navbar navbar-light alpha-info border-info navbar-expand-md"> <!-- Header --> <div class="navbar-header navbar-dark [...]"> <div class="navbar-brand navbar-brand-md"> ... </div> <div class="navbar-brand navbar-brand-xs"> ... </div> </div> <!-- /header --> <!-- Mobile toggler --> <div class="d-md-none"> ... </div> <!-- /mobile toggler --> <!-- Navbar content --> <div class="collapse navbar-collapse" id="navbar-main"> ... </div> <!-- /navbar content --></div><!-- /custom light color -->
Custom dark color markup:
<!-- Custom dark color --><div class="navbar navbar-dark bg-blue navbar-expand-md"> <!-- Header --> <div class="navbar-header navbar-dark [...]"> <div class="navbar-brand navbar-brand-md"> ... </div> <div class="navbar-brand navbar-brand-xs"> ... </div> </div> <!-- /header --> <!-- Mobile toggler --> <div class="d-md-none"> ... </div> <!-- /mobile toggler --> <!-- Navbar content --> <div class="collapse navbar-collapse" id="navbar-main"> ... </div> <!-- /navbar content --></div><!-- /custom dark color -->
Color combinations
Background colors in multiple navbars can be mixed: you can specify custom background colors for mainand secondarynavbars or make them look identical. All navbars have top and bottom borders, so in some color combinations you might need to use borderutility classes to remove some borders, change border color or make them transparent (prefered for correct padding calculations in SASS).
Example of mixing dark colors:
Multiple navbars markup:
<!-- First navbar --><div class="navbar navbar-dark bg-teal-400 navbar-expand-md"> <!-- Navbar content --> <div class="navbar-header"> ... </div> <div class="d-md-none"> ... </div> <div class="collapse navbar-collapse" id="navbar-first"> ... </div> <!-- /navbar content --></div><!-- /first navbar --><!-- Second navbar --><div class="navbar navbar-dark bg-slate-700 navbar-expand-md"> <!-- Navbar content --> <div class="navbar-header"> ... </div> <div class="d-md-none"> ... </div> <div class="collapse navbar-collapse" id="navbar-second"> ... </div> <!-- /navbar content --></div><!-- /second navbar -->
Navbar classes
| Class | Type | Description |
|---|---|---|
.navbar
|
Required | Default navbar class, must be used with any navbar type and color. Responsible for basic navbar and navbar components styling as a parent container. |
.navbar-light
|
Required |
This class is used for darkbackground colors - default dark color is set in $navbar-light-bgvariable, feel free to adjust the color according to your needs.
|
.navbar-light.alpha-*
|
Optional |
Combination of these classes allows you to set custom lightcolor to the lightnavbar. Note - .navbar-lightis required, it's responsible for correct content styling.
|
.navbar-dark
|
Required |
This class is used for darkbackground colors - default dark color is set in $navbar-dark-bgvariable, feel free to adjust the color according to your needs.
|
.navbar-dark.bg-*
|
Optional |
Combination of these classes allows you to set custom darkcolor to the darknavbar. Note - .navbar-darkis required, it's responsible for correct content styling.
|
.navbar-expand-[breakpoint]
|
Optional |
For navbars that never collapse, add the .navbar-expandclass on the navbar. For navbars that always collapse, don’t add any .navbar-expandclass. Otherwise use this class to change when navbar content collapses behind a button.
|
.navbar-header
|
Optional |
Navbar brand wrapper. This class is responsible for navbar logo section with custom background color. Must contain children .navbar-brandcontainer(s).
|
.navbar-brand
|
Required | Class for logo container. It can be applied to most elements, but an anchor works best as some elements might require utility classes or custom styles |
.navbar-brand-[md, xs]
|
Required |
These classes toggle logos - xsis hidden by default and is visible if main sidebar is collapsed, mdis visible by default and is hidden when main sidebar is expanded
|
.navbar-toggler
|
Required | This class needs to be added to the navbar toggle button that toggles navbar content on small screens. Always used with visibility utility classes. |
.navbar-collapse
|
Required | Groups and hides navbar contents by a parent breakpoint. Requires an ID for targeting collapsible container when sidebar content is collapsed. |
.navbar-nav
|
Required | Responsive navigation container class that adds default styling for navbar navigation. |
.nav-item
|
Required | Wrapper class for immediate parents of all navigation links. Responsible for correct styling of nav items |
.navbar-nav-link
|
Required |
Custom class for links within .navbar-navlist, it sets proper styling for links in light and dark navbars.
|
.navbar-text
|
Required | This class adjusts vertical alignment and horizontal spacing for strings of text |
.navbar-component
|
Optional | Display navbar as a stand alone component, with border and rounded corners. |
.fixed-top
|
Optional |
Makes navbar sticked to the topof the page. Requires proper class for <body>container, see the table below.
|
.fixed-bottom
|
Optional |
Makes navbar sticked to the bottomof the page. Requires proper class for <body>container, see the table below.
|
.sticky-top
|
Optional |
Adds position: sticky;to the navbar - it's treated as relatively positioned until its containing block crosses a specified threshold, at which point it is treated as fixed. Support is limited.
|
Body classes
position: fixed, meaning they’re pulled from the normal flow of the DOM and require custom classes added to the <body>container to prevent overlap with other elements. The following table demonstrates the list of classes for <body>container if navbar has non-static position:
| Class | Description |
|---|---|
.navbar-top
|
This class adds toppadding to the <body>container. Works only with default navbar height. If another height is specified, apply another class (see the line below).
|
.navbar-bottom
|
This class adds bottompadding to the <body>container. Works only with default navbar height. If another height is specified, apply another class (see the line below).
|
.navbar-top-[size]
|
Controls topspacing of <body>container, if navbar has optional height. Available sizes: small (*-sm) and large (*-lg). Default navbar requires .navbar-topclass only.
|
.navbar-bottom-[size]
|
Controls bottomspacing of <body>container, if navbar has optional height. Available sizes: small (*-sm) and large (*-lg). Default navbar requires .navbar-bottomclass only.
|
.navbar-top-[size]-[size]
|
Use these classes if the layout has multiple topnavbars, where first [size]is the size of the first navbar, second [size]- height of the second navbar. In this particular use case, [size]can be: lgif large height, mdis default height smis small height.
|
.navbar-bottom-[size]-[size]
|
Use these classes if the layout has multiple bottomnavbars, where first [size]is the size of the first navbar, second [size]- height of the second navbar. In this particular use case, [size]can be: lgif large height, mdis default height smis small height.
|

English
Українська
Deutsch
España
Русский
