The b.Navbar
constructor creates a navbar. The brand section is added only if at least one brand, start or end child is provided. The section part and the burger button are added only if at least one start or end child is provided. The click event on the burger, which toggles the navbar menu on mobile devices, is already included.
Modifier | Action |
---|---|
b.FixedTop | Fix the navbar to the top of the page - the has-navbar-fixed-top class is automatically added to the parent element (which should be the body for this to work) |
b.FixedBottom | Fix the navbar to the bottom of the page - the has-navbar-fixed-bottom class is automatically added to the parent element (which should be the body for this to work) |
b.Transparent | Remove hover and active backgrounds from the items |
b.Spaced | Increase padding |
b.Shadow | Add a small shadow around the navbar |
b.Primary | Set color to primary |
b.Link | Set color to link |
b.Info | Set color to info |
b.Success | Set color to success |
b.Warning | Set color to warning |
b.Danger | Set color to danger |
b.Black | Set color to black |
b.Light | Set color to light |
b.Dark | Set color to dark |
b.White | Set color to white |
Child | Action |
---|---|
b.NavbarBrand(...any) | Apply children to the brand section (left side, always visible) |
b.NavbarStart(...any) | Apply children to the start section (left part of the menu) |
b.NavbarEnd(...any) | Apply children to the end section (right part of the menu) |
b.Container(...any) | Use element as an intermediate container |
Anything else | Apply children to the <nav class="navbar"> element |
The b.NavbarItem
constructor creates a navbar item for a navbar brand, start or end section, or for a b.NavbarDropdown
.
Modifier | Action |
---|---|
b.Expanded | Turn the item into a full-width element |
b.Tab | Add a bottom border on hover, always show the bottom border when adding b.Active |
b.HasDropdown | Make the item a link+dropdown container |
b.HasDropup | Make the item a dropdown container, with the dropdown opening above the link |
b.Hoverable | Make the included dropdown automatically show on hover |
b.Active | Force the dropdown to be open |
The b.NavbarAHref
constructor creates a link item for a navbar brand, start or end section, or to a b.NavbarDropdown
.
Modifier | Action |
---|---|
b.Expanded | Turn the item into a full-width element |
b.Tab | Add a bottom border on hover, always show the bottom border when adding b.Active |
The b.NavbarDropdown
constructor creates navbar item with a dropdown menu.
Modifier | Action |
---|---|
b.Hoverable | Make the menu open when the cursor hovers the trigger |
b.Clickable | Make the menu open when the button is clicked (javascript is automatically added) |
b.Up | Make the dropdown open to the top |
b.Arrowless | Remove the arrow in the item |
b.Boxed | Show the dropdown as a boxed element, without the top grey border |
b.Active | Force the dropdown to be open |
b.Right | Used when a dropdown is on the right side (end section), in order to open its content aligned to the right of the link |
Child | Action |
---|---|
b.OnItem(...any) | Apply children to the <div class="navbar-item"> element |
b.OnLink(...any) | Apply children to the <a class="navbar-link"> element |
b.OnDropdown(...any) | Apply children to the <div class="navbar-dropdown"> element |
e.Class | Apply class to the <div class="navbar-dropdown"> element |
string | Add string to the <a class="navbar-link"> element |
Anything else | Apply child to the <div class="navbar-dropdown"> element |
The b.NavbarLink
constructor creates a link element, to include in a b.NavbarItem
with the b.HasDropdown
modifier.
Modifier | Action |
---|---|
b.Arrowless | Remove the arrow in the item |
The b.NavbarDivider
constructor creates a divider element, to include in a b.NavbarDropdown
.