Navbar
This documentation provides a comprehensive reference for the
Navbar, NavbarBrand, NavbarNav, NavbarItem, NavbarDropdown, and NavbarText components, guiding you through their configuration options.Screenshot #

Navbar Parameters #
| Name | Type | Default | Required | Description | Added Version |
|---|---|---|---|---|---|
| AdditionalAttributes | Dictionary<string, object>? | null | Gets or sets additional attributes that will be applied to the component. | 4.1.0 | |
| AriaLabel | string? | null | Gets or sets the accessible name of the navigation landmark, read by screen readers. Set it when the page has more than one navigation landmark. | 4.1.0 | |
| BackgroundColor | BackgroundColor | None | Gets or sets the background color, applied with Bootstrap's bg-* classes. | 4.1.0 | |
| Brand | RenderFragment? | null | Gets or sets the brand, usually a NavbarBrand. | 4.1.0 | |
| BrandInCollapse | bool | False | Gets or sets whether the brand is placed inside the collapsed menu, so it is hidden until the menu expands. Ignored when ExternalCollapseId is set, because there is no menu inside the navbar to hold it. | 4.1.0 | |
| ChildContent | RenderFragment? | null | Gets or sets the content of the menu: NavbarNav, NavbarText, forms, input groups, or buttons. It collapses behind the toggler below ExpandBreakpoint. | 4.1.0 | |
| Class | string? | null | Gets or sets the CSS class name(s) to apply to the component. | 4.1.0 | |
| CollapseMode | NavbarCollapseMode | Collapse | Gets or sets how the menu is shown below ExpandBreakpoint: in a collapse region or an offcanvas panel. | 4.1.0 | |
| Color | NavbarColor | None | Gets or sets the contextual background color, applied with Bootstrap's text-bg-* classes. Pair a dark color with NavbarTheme.Dark. | 4.1.0 | |
| Container | NavbarContainer | Fluid | Gets or sets the width of the container inside the navbar. | 4.1.0 | |
| ExpandBreakpoint | NavbarExpand | Large | Gets or sets the breakpoint at which the navbar expands from its collapsed menu to a horizontal bar. | 4.1.0 | |
| ExternalCollapseId | string? | null | Gets or sets the id of a Collapse outside the navbar that the toggler shows and hides. When set, ChildContent is not collapsed, and focus moves into the collapse when it opens. | 4.1.0 | |
| Id | string? | null | Gets or sets the ID. If not set, a unique ID will be generated. | 4.1.0 | |
| OffcanvasCloseButtonAriaLabel | string | Close | Gets or sets the accessible label of the offcanvas close button. | 4.1.0 | |
| OffcanvasPlacement | Placement | End | Gets or sets the side the offcanvas panel opens from when CollapseMode is Offcanvas. | 4.1.0 | |
| OffcanvasTitle | string? | null | Gets or sets the title of the offcanvas panel. It also names the panel for screen readers. Without a title, the panel is named by AriaLabel, so set one of the two. | 4.1.0 | |
| Placement | NavbarPlacement | Static | Gets or sets where the navbar is placed on the page. | 4.1.0 | |
| Style | string? | null | Gets or sets the CSS style string that defines the inline styles for the component. | 4.1.0 | |
| Theme | NavbarTheme | None | Gets or sets the color theme, set through Bootstrap's data-bs-theme attribute. | 4.1.0 | |
| TogglerAriaLabel | string | Toggle navigation | Gets or sets the accessible label of the toggler button. | 4.1.0 | |
| TogglerPosition | NavbarTogglerPosition | End | Gets or sets where the toggler is placed relative to the brand. | 4.1.0 |
Navbar Methods #
| Name | Return type | Description | Added Version |
|---|---|---|---|
| HideAsync() | Task | Hides the collapsed menu. Does nothing when the navbar is expanded or the menu is already hidden. | 4.1.0 |
| ShowAsync() | Task | Shows the collapsed menu. | 4.1.0 |
| ToggleAsync() | Task | Shows the collapsed menu if it is hidden, or hides it if it is shown. | 4.1.0 |
NavbarBrand Parameters #
| Name | Type | Default | Required | Description | Added Version |
|---|---|---|---|---|---|
| AdditionalAttributes | Dictionary<string, object>? | null | Gets or sets additional attributes that will be applied to the component. | 4.1.0 | |
| ChildContent | RenderFragment? | null | Gets or sets the brand text, shown after the image when both are set. | 4.1.0 | |
| Class | string? | null | Gets or sets the CSS class name(s) to apply to the component. | 4.1.0 | |
| Href | string? | null | Gets or sets the link of the brand. When null, the brand renders as plain text. | 4.1.0 | |
| Id | string? | null | Gets or sets the ID. If not set, a unique ID will be generated. | 4.1.0 | |
| ImageAlt | string? | null | Gets or sets the alternative text of the brand image. Set it to the brand name when the image is shown without text. | 4.1.0 | |
| ImageHeight | int? | null | Gets or sets the height of the brand image, in pixels. | 4.1.0 | |
| ImageSrc | string? | null | Gets or sets the source of the brand image. | 4.1.0 | |
| ImageWidth | int? | null | Gets or sets the width of the brand image, in pixels. | 4.1.0 | |
| Style | string? | null | Gets or sets the CSS style string that defines the inline styles for the component. | 4.1.0 |
NavbarNav Parameters #
| Name | Type | Default | Required | Description | Added Version |
|---|---|---|---|---|---|
| AdditionalAttributes | Dictionary<string, object>? | null | Gets or sets additional attributes that will be applied to the component. | 4.1.0 | |
| ChildContent | RenderFragment? | null | Gets or sets the items of the navigation: NavbarItem and NavbarDropdown components. | 4.1.0 | |
| Class | string? | null | Gets or sets the CSS class name(s) to apply to the component. | 4.1.0 | |
| Id | string? | null | Gets or sets the ID. If not set, a unique ID will be generated. | 4.1.0 | |
| Scrollable | bool | False | Gets or sets whether the collapsed navigation scrolls within ScrollHeight instead of growing to fit its items. | 4.1.0 | |
| ScrollHeight | string | 75vh | Gets or sets the maximum height of the scrolling navigation when Scrollable is true, as a CSS length. | 4.1.0 | |
| Style | string? | null | Gets or sets the CSS style string that defines the inline styles for the component. | 4.1.0 |
NavbarItem Parameters #
| Name | Type | Default | Required | Description | Added Version |
|---|---|---|---|---|---|
| AdditionalAttributes | Dictionary<string, object>? | null | Gets or sets additional attributes that will be applied to the component. | 4.1.0 | |
| ChildContent | RenderFragment? | null | Gets or sets the content of the link. | 4.1.0 | |
| Class | string? | null | Gets or sets the CSS class name(s) to apply to the component. | 4.1.0 | |
| Disabled | bool | False | Gets or sets whether the link is disabled. A disabled link has no href and is marked aria-disabled="true". | 4.1.0 | |
| Href | string? | null | Gets or sets the URL of the link. | 4.1.0 | |
| Id | string? | null | Gets or sets the ID. If not set, a unique ID will be generated. | 4.1.0 | |
| Match | NavLinkMatch | Prefix | Gets or sets how the link matches the current URL to become active. Use NavLinkMatch.All for a home link, so it is not active on every page. | 4.1.0 | |
| Style | string? | null | Gets or sets the CSS style string that defines the inline styles for the component. | 4.1.0 |
NavbarDropdown Parameters #
| Name | Type | Default | Required | Description | Added Version |
|---|---|---|---|---|---|
| AdditionalAttributes | Dictionary<string, object>? | null | Gets or sets additional attributes that will be applied to the component. | 4.1.0 | |
| ChildContent | RenderFragment? | null | Gets or sets the menu items: DropdownItem, DropdownHeader, and DropdownDivider components. | 4.1.0 | |
| Class | string? | null | Gets or sets the CSS class name(s) to apply to the component. | 4.1.0 | |
| Id | string? | null | Gets or sets the ID. If not set, a unique ID will be generated. | 4.1.0 | |
| MenuEnd | bool | False | Gets or sets whether the menu is aligned to the end of the toggle instead of the start, when the navbar is expanded. | 4.1.0 | |
| Style | string? | null | Gets or sets the CSS style string that defines the inline styles for the component. | 4.1.0 | |
| Text | string? | null | Gets or sets the text of the dropdown toggle. | 4.1.0 |
NavbarText Parameters #
| Name | Type | Default | Required | Description | Added Version |
|---|---|---|---|---|---|
| AdditionalAttributes | Dictionary<string, object>? | null | Gets or sets additional attributes that will be applied to the component. | 4.1.0 | |
| ChildContent | RenderFragment? | null | Gets or sets the text. | 4.1.0 | |
| Class | string? | null | Gets or sets the CSS class name(s) to apply to the component. | 4.1.0 | |
| Id | string? | null | Gets or sets the ID. If not set, a unique ID will be generated. | 4.1.0 | |
| Style | string? | null | Gets or sets the CSS style string that defines the inline styles for the component. | 4.1.0 |