Nav
Tree
TreeView
Tree
TreeView
A navigation pane (Nav) provides links to the main areas of an app or site. This component can also be sued as a TreeView to show parent-child data in a tree.
Notes
The BitNav is a Multi-API component
which can accept the list of Items in 3 different ways:
1. The BitNavItem class
2. A Custom Generic class
3. The BitNavOption component
Usage
Basic
<BitNav Items="basicNavItems" />@code { private static readonly List<BitNavItem> basicNavItems = [ new() { Text = "bit platform", Description = "the bit platform description", ChildItems = [ new() { Text = "Home", IconName = BitIconName.Home, Url = "https://bitplatform.dev/" }, new() { Text = "Products & Services", ChildItems = [ new() { Text = "Project Templates", ChildItems = [ new() { Text = "Todo sample", IconName = BitIconName.ToDoLogoOutline, Url = "https://bitplatform.dev/templates/overview" }, new() { Text = "AdminPanel sample", IconName = BitIconName.LocalAdmin, Url = "https://bitplatform.dev/templates/overview" }, ] }, new() { Text = "BlazorUI", IconName = BitIconName.F12DevTools, Url = "https://bitplatform.dev/components" }, new() { Text = "Cloud hosting solutions", IconName = BitIconName.Cloud, Url = "https://bitplatform.dev/#", IsEnabled = false }, new() { Text = "Bit academy", IconName = BitIconName.LearningTools, Url = "https://bitplatform.dev/#", IsEnabled = false }, ] }, new() { Text = "Pricing", IconName = BitIconName.Money, Url = "https://bitplatform.dev/pricing" }, new() { Text = "About", IconName = BitIconName.Info, Url = "https://bitplatform.dev/about-us" }, new() { Text = "Contact us", IconName = BitIconName.Contact, Url = "https://bitplatform.dev/contact-us" }, ], }, new() { Text = "Community", ChildItems = [ new() { Text = "LinkedIn", IconName = BitIconName.LinkedInLogo , Url = "https://www.linkedin.com/company/bitplatformhq" }, new() { Text = "Twitter", IconName = BitIconName.Globe , Url = "https://twitter.com/bitplatformhq" }, new() { Text = "GitHub repo", IconName = BitIconName.GitGraph , Url = "https://github.com/bitfoundation/bitplatform" }, ] }, new() { Text = "Iconography", IconName = BitIconName.AppIconDefault, Url = "/iconography" }, ]; }
FitWidth
<BitNav Items="basicNavItems" FitWidth />@code { private static readonly List<BitNavItem> basicNavItems = [ new() { Text = "bit platform", Description = "the bit platform description", ChildItems = [ new() { Text = "Home", IconName = BitIconName.Home, Url = "https://bitplatform.dev/" }, new() { Text = "Products & Services", ChildItems = [ new() { Text = "Project Templates", ChildItems = [ new() { Text = "Todo sample", IconName = BitIconName.ToDoLogoOutline, Url = "https://bitplatform.dev/templates/overview" }, new() { Text = "AdminPanel sample", IconName = BitIconName.LocalAdmin, Url = "https://bitplatform.dev/templates/overview" }, ] }, new() { Text = "BlazorUI", IconName = BitIconName.F12DevTools, Url = "https://bitplatform.dev/components" }, new() { Text = "Cloud hosting solutions", IconName = BitIconName.Cloud, Url = "https://bitplatform.dev/#", IsEnabled = false }, new() { Text = "Bit academy", IconName = BitIconName.LearningTools, Url = "https://bitplatform.dev/#", IsEnabled = false }, ] }, new() { Text = "Pricing", IconName = BitIconName.Money, Url = "https://bitplatform.dev/pricing" }, new() { Text = "About", IconName = BitIconName.Info, Url = "https://bitplatform.dev/about-us" }, new() { Text = "Contact us", IconName = BitIconName.Contact, Url = "https://bitplatform.dev/contact-us" }, ], }, new() { Text = "Community", ChildItems = [ new() { Text = "LinkedIn", IconName = BitIconName.LinkedInLogo , Url = "https://www.linkedin.com/company/bitplatformhq" }, new() { Text = "Twitter", IconName = BitIconName.Globe , Url = "https://twitter.com/bitplatformhq" }, new() { Text = "GitHub repo", IconName = BitIconName.GitGraph , Url = "https://github.com/bitfoundation/bitplatform" }, ] }, new() { Text = "Iconography", IconName = BitIconName.AppIconDefault, Url = "/iconography" }, ]; }
Grouped
<BitNav Items="carNavItems" RenderType="BitNavRenderType.Grouped" />@code { private static readonly List<BitNavItem> carNavItems = [ new() { Text = "Mercedes-Benz", ExpandAriaLabel = "Mercedes-Benz Expanded", CollapseAriaLabel = "Mercedes-Benz Collapsed", Title = "Mercedes-Benz Car Models", IsExpanded = true, Description = "Cars manufactured under the brand of Mercedes-Benz", ChildItems = [ new() { Text = "SUVs", ChildItems = [ new() { Text = "GLA", Url = "https://www.mbusa.com/en/vehicles/class/gla/suv", Target = "_blank" }, new() { Text = "GLB", Url = "https://www.mbusa.com/en/vehicles/class/glb/suv", Target = "_blank" }, new() { Text = "GLC", Url = "https://www.mbusa.com/en/vehicles/class/glc/suv", Target = "_blank" }, ] }, new() { Text = "Sedans & Wagons", ChildItems = [ new() { Text = "A Class", Url = "https://www.mbusa.com/en/vehicles/class/a-class/sedan", Target = "_blank" }, new() { Text = "C Class", Url = "https://www.mbusa.com/en/vehicles/class/c-class/sedan", Target = "_blank" }, new() { Text = "E Class", Url = "https://www.mbusa.com/en/vehicles/class/e-class/sedan", Target = "_blank" }, ] }, new() { Text = "Coupes", ChildItems = [ new() { Text = "CLA Coupe", Url = "https://www.mbusa.com/en/vehicles/class/cla/coupe", Target = "_blank" }, new() { Text = "C Class Coupe", Url = "https://www.mbusa.com/en/vehicles/class/c-class/coupe", Target = "_blank" }, new() { Text = "E Class Coupe", Url = "https://www.mbusa.com/en/vehicles/class/e-class/coupe", Target = "_blank" }, ] }, ] }, new() { Text = "Tesla", ExpandAriaLabel = "Tesla Expanded", CollapseAriaLabel= "Tesla Collapsed", Title = "Tesla Car Models", ChildItems = [ new() { Text = "Model S", Url = "https://www.tesla.com/models", Target = "_blank" }, new() { Text = "Model X", Url = "https://www.tesla.com/modelx", Target = "_blank" }, new() { Text = "Model Y", Url = "https://www.tesla.com/modely", Target = "_blank" }, ] }, ]; }
Manual Mode
Basic
Two-Way Bind
French Fries
<div>Basic</div> <BitNav Items="foodNavItems" DefaultSelectedItem="foodNavItems[0].Items[2]" Mode="BitNavMode.Manual" /> <div>Two-Way Bind</div> <BitNav @bind-SelectedItem="SelectedItemNav" Items="foodNavItems" Mode="BitNavMode.Manual" OnSelectItem="(BitNavItem item) => SelectedItemText = FoodMenuDropdownItems.FirstOrDefault(i => i.Text == item.Text).Text" /> <BitDropdown @bind-Value="SelectedItemText" Label="Select Item" Items="FoodMenuDropdownItems" OnSelectItem="(item) => SelectedItemNav = Flatten(foodNavItems).FirstOrDefault(i => i.Text == item.Value)" />@code { private static readonly List<BitNavItem> foodNavItems = [ new() { Text = "Fast foods", IconName = BitIconName.HeartBroken, IsExpanded = true, Description = "List of fast foods", ChildItems = [ new() { Text = "Burgers", Description = "List of burgers", ChildItems = [ new() { Text = "Beef Burger" }, new() { Text = "Veggie Burger" }, new() { Text = "Bison Burger" }, new() { Text = "Wild Salmon Burger" }, ] }, new() { Text = "Pizza", ChildItems = [ new() { Text = "Cheese Pizza" }, new() { Text = "Veggie Pizza" }, new() { Text = "Pepperoni Pizza" }, new() { Text = "Meat Pizza" }, ] }, new() { Text = "French Fries" }, ] }, new() { Text = "Fruits", IconName = BitIconName.Health, ChildItems = [ new() { Text = "Apple" }, new() { Text = "Orange" }, new() { Text = "Banana" }, ] }, new() { Text = "Ice Cream" }, new() { Text = "Cookie" }, ]; private static readonly List<BitDropdownItem> FoodMenuDropdownItems = new() { new() { Text = "Beef Burger", Value = "Beef Burger", }, new() { Text = "Veggie Burger", Value = "Veggie Burger", }, new() { Text = "Bison Burger", Value = "Bison Burger", }, new() { Text = "Wild Salmon Burger", Value = "Wild Salmon Burger", }, new() { Text = "Cheese Pizza", Value = "Cheese Pizza", }, new() { Text = "Veggie Pizza", Value = "Veggie Pizza", }, new() { Text = "Pepperoni Pizza", Value = "Pepperoni Pizza", }, new() { Text = "Meat Pizza", Value = "Meat Pizza", }, new() { Text = "French Fries", Value = "French Fries", }, new() { Text = "Aplle", Value = "Aplle", }, new() { Text = "Orange", Value = "Orange", }, new() { Text = "Benana", Value = "Benana", }, new() { Text = "Ice Cream", Value = "Ice Cream", }, new() { Text = "Cookie", Value = "Cookie", }, }; private static List<BitNavItem> Flatten(IList<BitNavItem> e) => e.SelectMany(c => Flatten(c.Items)).Concat(e).ToList(); private BitNavItem SelectedItemNav = foodNavItems[0].Items[2]; private string SelectedItemText = foodNavItems[0].Items[2].Text; }
IconOnly
<BitToggle @bind-Value="iconOnly" Label="Hide texts?" Inline /> <BitNav Items="iconOnlyNavItems" Mode="BitNavMode.Manual" IconOnly="iconOnly" />@code { private bool iconOnly; private static readonly List<BitNavItem> iconOnlyNavItems = [ new() { Text = "Home", IconName = BitIconName.Home }, new() { Text = "AdminPanel sample", IconName = BitIconName.LocalAdmin, ChildItems = [ new() { Text = "Dashboard", IconName = BitIconName.ViewDashboard }, new() { Text = "Categories", IconName = BitIconName.BuildQueue }, new() { Text = "Products", IconName = BitIconName.Product }, ] }, new() { Text = "Todo sample", IconName = BitIconName.ToDoLogoOutline}, new() { Text = "BlazorUI", IconName = BitIconName.F12DevTools }, new() { Text = "Bit academy", IconName = BitIconName.LearningTools, IsEnabled = false }, new() { Text = "Contact us", IconName = BitIconName.Contact }, ]; }
Custom Templates
Header Template (Grouped)
Item Template
<style> .nav-custom-header { font-size: 17px; font-weight: 600; color: green; } .nav-custom-item { display: flex; align-items: center; flex-flow: row nowrap; gap: 4px; color: #ff7800; font-weight: 600; } </style> <div>Header Template (in Grouped mode)</div> <BitNav Items="carNavItems" RenderType="BitNavRenderType.Grouped"> <HeaderTemplate Context="item"> <div class="nav-custom-header"> <BitIcon IconName="@BitIconName.FavoriteStarFill" /> <span>@item.Text</span> </div> </HeaderTemplate> </BitNav> <div>Item Template</div> <BitNav Items="foodNavItems" Mode="BitNavMode.Manual"> <ItemTemplate Context="item"> <div class="nav-custom-item"> <BitCheckbox /> <BitIcon IconName="@item.IconName" /> <span>@item.Text</span> </div> </ItemTemplate> </BitNav>@code { private static readonly List<BitNavItem> carNavItems = [ new() { Text = "Mercedes-Benz", ExpandAriaLabel = "Mercedes-Benz Expanded", CollapseAriaLabel = "Mercedes-Benz Collapsed", Title = "Mercedes-Benz Car Models", IsExpanded = true, Description = "Cars manufactured under the brand of Mercedes-Benz", ChildItems = [ new() { Text = "SUVs", ChildItems = [ new() { Text = "GLA", Url = "https://www.mbusa.com/en/vehicles/class/gla/suv", Target = "_blank" }, new() { Text = "GLB", Url = "https://www.mbusa.com/en/vehicles/class/glb/suv", Target = "_blank" }, new() { Text = "GLC", Url = "https://www.mbusa.com/en/vehicles/class/glc/suv", Target = "_blank" }, ] }, new() { Text = "Sedans & Wagons", ChildItems = [ new() { Text = "A Class", Url = "https://www.mbusa.com/en/vehicles/class/a-class/sedan", Target = "_blank" }, new() { Text = "C Class", Url = "https://www.mbusa.com/en/vehicles/class/c-class/sedan", Target = "_blank" }, new() { Text = "E Class", Url = "https://www.mbusa.com/en/vehicles/class/e-class/sedan", Target = "_blank" }, ] }, new() { Text = "Coupes", ChildItems = [ new() { Text = "CLA Coupe", Url = "https://www.mbusa.com/en/vehicles/class/cla/coupe", Target = "_blank" }, new() { Text = "C Class Coupe", Url = "https://www.mbusa.com/en/vehicles/class/c-class/coupe", Target = "_blank" }, new() { Text = "E Class Coupe", Url = "https://www.mbusa.com/en/vehicles/class/e-class/coupe", Target = "_blank" }, ] }, ] }, new() { Text = "Tesla", ExpandAriaLabel = "Tesla Expanded", CollapseAriaLabel= "Tesla Collapsed", Title = "Tesla Car Models", ChildItems = [ new() { Text = "Model S", Url = "https://www.tesla.com/models", Target = "_blank" }, new() { Text = "Model X", Url = "https://www.tesla.com/modelx", Target = "_blank" }, new() { Text = "Model Y", Url = "https://www.tesla.com/modely", Target = "_blank" }, ] }, ]; private static readonly List<BitNavItem> foodNavItems = [ new() { Text = "Fast foods", IconName = BitIconName.HeartBroken, IsExpanded = true, Description = "List of fast foods", ChildItems = [ new() { Text = "Burgers", Description = "List of burgers", ChildItems = [ new() { Text = "Beef Burger" }, new() { Text = "Veggie Burger" }, new() { Text = "Bison Burger" }, new() { Text = "Wild Salmon Burger" }, ] }, new() { Text = "Pizza", ChildItems = [ new() { Text = "Cheese Pizza" }, new() { Text = "Veggie Pizza" }, new() { Text = "Pepperoni Pizza" }, new() { Text = "Meat Pizza" }, ] }, new() { Text = "French Fries" }, ] }, new() { Text = "Fruits", IconName = BitIconName.Health, ChildItems = [ new() { Text = "Apple" }, new() { Text = "Orange" }, new() { Text = "Banana" }, ] }, new() { Text = "Ice Cream" }, new() { Text = "Cookie" }, ]; }
Events
Clicked Item:
Selected Item:
Toggled Item: N/A
Selected Item:
Toggled Item: N/A
<BitNav Items="foodNavItems" Mode="BitNavMode.Manual" OnItemClick="(BitNavItem item) => ClickedItem = item" OnSelectItem="(BitNavItem item) => SelectedItem = item" OnItemToggle="(BitNavItem item) => ToggledItem = item" /> <span>Clicked Item: @ClickedItem?.Text</span> <span>Selected Item: @SelectedItem?.Text</span> <span>Toggled Item: @(ToggledItem is null ? "N/A" : $"{ToggledItem.Text} ({(ToggledItem.IsExpanded ? "Expanded" : "Collapsed")})")</span>@code { private static readonly List<BitNavItem> foodNavItems = [ new() { Text = "Fast foods", IconName = BitIconName.HeartBroken, IsExpanded = true, Description = "List of fast foods", ChildItems = [ new() { Text = "Burgers", Description = "List of burgers", ChildItems = [ new() { Text = "Beef Burger" }, new() { Text = "Veggie Burger" }, new() { Text = "Bison Burger" }, new() { Text = "Wild Salmon Burger" }, ] }, new() { Text = "Pizza", ChildItems = [ new() { Text = "Cheese Pizza" }, new() { Text = "Veggie Pizza" }, new() { Text = "Pepperoni Pizza" }, new() { Text = "Meat Pizza" }, ] }, new() { Text = "French Fries" }, ] }, new() { Text = "Fruits", IconName = BitIconName.Health, ChildItems = [ new() { Text = "Apple" }, new() { Text = "Orange" }, new() { Text = "Banana" }, ] }, new() { Text = "Ice Cream" }, new() { Text = "Cookie" }, ]; private BitNavItem ClickedItem; private BitNavItem SelectedItem; private BitNavItem ToggledItem; }
AllExpanded & NoCollapse
<BitNav Items="noCollapseNavItems" AllExpanded NoCollapse />@code { private static readonly List<BitNavItem> noCollapseNavItems = [ new() { Text = "bit platform", Description = "the bit platform description", ChildItems = [ new() { Text = "Home", IconName = BitIconName.Home, Url = "https://bitplatform.dev/" }, new() { Text = "Products & Services", ChildItems = [ new() { Text = "Project Templates", ChildItems = [ new() { Text = "Todo sample", IconName = BitIconName.ToDoLogoOutline, Url = "https://bitplatform.dev/templates/overview" }, new() { Text = "AdminPanel sample", IconName = BitIconName.LocalAdmin, Url = "https://bitplatform.dev/templates/overview" }, ] }, new() { Text = "BlazorUI", IconName = BitIconName.F12DevTools, Url = "https://bitplatform.dev/components" }, new() { Text = "Cloud hosting solutions", IconName = BitIconName.Cloud, Url = "https://bitplatform.dev/#", IsEnabled = false }, new() { Text = "Bit academy", IconName = BitIconName.LearningTools, Url = "https://bitplatform.dev/#", IsEnabled = false }, ] }, new() { Text = "Pricing", IconName = BitIconName.Money, Url = "https://bitplatform.dev/pricing" }, new() { Text = "About", IconName = BitIconName.Info, Url = "https://bitplatform.dev/about-us" }, new() { Text = "Contact us", IconName = BitIconName.Contact, Url = "https://bitplatform.dev/contact-us" }, ], }, new() { Text = "Community", ChildItems = [ new() { Text = "LinkedIn", IconName = BitIconName.LinkedInLogo , Url = "https://www.linkedin.com/company/bitplatformhq" }, new() { Text = "Twitter", IconName = BitIconName.Globe , Url = "https://twitter.com/bitplatformhq" }, new() { Text = "GitHub repo", IconName = BitIconName.GitGraph , Url = "https://github.com/bitfoundation/bitplatform" }, ] }, new() { Text = "Iconography", IconName = BitIconName.AppIconDefault, Url = "/iconography" }, ]; }
Custom Styles
<BitNav Items="customStyleNavItems" Styles="@(new() { ItemContainer = "border: 1px solid green; margin: 2px;", ToggleButton = "color: cyan;", Item = "color: red;", ItemIcon = "color: gold; margin-right: 15px;" })" />@code { private static readonly List<BitNavItem> customStyleNavItems = [ new() { Text = "bit platform", Description = "the bit platform description", ChildItems = [ new() { Text = "Home", IconName = BitIconName.Home, Url = "https://bitplatform.dev/" }, new() { Text = "Products & Services", ChildItems = [ new() { Text = "Project Templates", ChildItems = [ new() { Text = "Todo sample", IconName = BitIconName.ToDoLogoOutline, Url = "https://bitplatform.dev/templates/overview" }, new() { Text = "AdminPanel sample", IconName = BitIconName.LocalAdmin, Url = "https://bitplatform.dev/templates/overview" }, ] }, new() { Text = "BlazorUI", IconName = BitIconName.F12DevTools, Url = "https://bitplatform.dev/components" }, new() { Text = "Cloud hosting solutions", IconName = BitIconName.Cloud, Url = "https://bitplatform.dev/#", IsEnabled = false }, new() { Text = "Bit academy", IconName = BitIconName.LearningTools, Url = "https://bitplatform.dev/#", IsEnabled = false }, ] }, new() { Text = "Pricing", IconName = BitIconName.Money, Url = "https://bitplatform.dev/pricing" }, new() { Text = "About", IconName = BitIconName.Info, Url = "https://bitplatform.dev/about-us" }, new() { Text = "Contact us", IconName = BitIconName.Contact, Url = "https://bitplatform.dev/contact-us" }, ], }, new() { Text = "Community", ChildItems = [ new() { Text = "LinkedIn", IconName = BitIconName.LinkedInLogo , Url = "https://www.linkedin.com/company/bitplatformhq" }, new() { Text = "Twitter", IconName = BitIconName.Globe , Url = "https://twitter.com/bitplatformhq" }, new() { Text = "GitHub repo", IconName = BitIconName.GitGraph , Url = "https://github.com/bitfoundation/bitplatform" }, ] }, new() { Text = "Iconography", IconName = BitIconName.AppIconDefault, Url = "/iconography" }, ]; }
RTL
<BitNav Dir="BitDir.Rtl" Items="RtlbasicNavItems" />@code { private static readonly List<BitNavItem> RtlbasicNavItems = [ new() { Text = "پلتفرمِ بیت", Description = "توضیحاتِ پلتفرمِ بیت", ChildItems = [ new() { Text = "خانه", IconName = BitIconName.Home, Url = "https://bitplatform.dev/" }, new() { Text = "محصولات و خدمات", ChildItems = [ new() { Text = "قالب های پروژه", ChildItems = [ new() { Text = "نمونه ی Todo", IconName = BitIconName.ToDoLogoOutline, Url = "https://bitplatform.dev/templates/overview" }, new() { Text = "نمونه ی AdminPanel", IconName = BitIconName.LocalAdmin, Url = "https://bitplatform.dev/templates/overview" }, ] }, new() { Text = "رابط کاربری Blazor", IconName = BitIconName.F12DevTools, Url = "https://blazorui-ai.bitplatform.dev/" }, new() { Text = "راه های هاست ابری", IconName = BitIconName.Cloud, Url = "https://bitplatform.dev/#", IsEnabled = false }, new() { Text = "آکادمی بیت", IconName = BitIconName.LearningTools, Url = "https://bitplatform.dev/#", IsEnabled = false }, ] }, new() { Text = "قیمت", IconName = BitIconName.Money, Url = "https://bitplatform.dev/pricing" }, new() { Text = "درباره ما", IconName = BitIconName.Info, Url = "https://bitplatform.dev/about-us" }, new() { Text = "ارتباط با ما", IconName = BitIconName.Contact, Url = "https://bitplatform.dev/contact-us" }, ], }, new() { Text = "انجمن ها", ChildItems = [ new() { Text = "لینکدین", IconName = BitIconName.LinkedInLogo , Url = "https://www.linkedin.com/company/bitplatformhq" }, new() { Text = "توییتر", IconName = BitIconName.Globe , Url = "https://twitter.com/bitplatformhq" }, new() { Text = "گیتهاب", IconName = BitIconName.GitGraph , Url = "https://github.com/bitfoundation/bitplatform" }, ] }, new() { Text = "شمایل نگاری", IconName = BitIconName.AppIconDefault, Url = "/iconography" }, ]; }
API
BitNav parameters
Name |
Type |
Default value |
Description |
|---|---|---|---|
| Accent | BitColor? | null | The accent color of the nav. |
| AllExpanded | bool | false | Expands all items on first render. |
| ChevronDownIcon | string? | null | The custom icon name of the chevron-down element of the BitNav component. |
| ChildContent | RenderFragment? | null | Items to render as children. |
| Classes | BitNavClassStyles? | null | Custom CSS classes for different parts of the BitNav component. |
| Color | BitColor? | null | The general color of the nav that is only used for colored parts like icons. |
| DefaultSelectedItem | TItem? | null | The initially selected item in manual mode. |
| FitWidth | bool | false | Renders the nav in a width to only fit its content. |
| FullWidth | bool | false | Renders the nav in full width of its container element. |
| HeaderTemplate | RenderFragment<TItem>? | null | Used to customize how content inside the group header is rendered. |
| HeaderTemplateRenderMode | BitNavItemTemplateRenderMode | BitNavItemTemplateRenderMode.Normal | The render mode of the custom HeaderTemplate. |
| IconOnly | bool | false | Only renders the icon of each nav item. |
| IndentPadding | int | 27 | The indentation padding in px for items without children (compensation space for chevron icon). |
| IndentReversedPadding | int | 4 | The indentation padding in px for items in reversed mode. |
| IndentValue | int | 16 | The indentation value in px for each level of depth of child item. |
| Items | IList<TItem> | new List<TItem>() | A collection of item to display in the navigation bar. |
| ItemTemplate | RenderFragment<TItem>? | null | Used to customize how content inside the item is rendered. |
| ItemTemplateRenderMode | BitNavItemTemplateRenderMode | BitNavItemTemplateRenderMode.Normal | The render mode of the custom ItemTemplate. |
| Match | BitNavMatch? | null | Gets or sets a value representing the global URL matching behavior of the nav. |
| Mode | BitNavMode | BitNavMode.Automatic | Determines how the navigation will be handled. |
| NameSelectors | BitNavNameSelectors<TItem>? | null | Names and selectors of the custom input type properties. |
| NoCollapse | bool | Hides all collapse/expand buttons and remove their spaces at the start of each node. | |
| OnItemClick | EventCallback<TItem> | Callback invoked when an item is clicked. | |
| OnItemToggle | EventCallback<TItem> | Callback invoked when a group header is clicked and Expanded or Collapse. | |
| OnSelectItem | EventCallback<TItem> | Callback invoked when an item is selected. | |
| RenderType | BitNavRenderType | BitNavRenderType.Normal | The way to render nav items. |
| Reselectable | bool | false | Enables recalling the select events when the same item is selected. |
| ReversedChevron | bool | false | Reverses the location of the expander chevron. |
| SelectedItem | TItem? | null | Selected item to show in the BitNav. |
| SingleExpand | bool | false | Enables the single-expand mode in the BitNav. |
| Styles | BitNavClassStyles? | null | Custom CSS styles for different parts of the BitNav component. |
BitNav public members
Name |
Type |
Default value |
Description |
|---|---|---|---|
| CollapseAll | Action<TItem? item> | Collapses all items and children. | |
| ExpandAll | Action<TItem? item> | Expands all items and children in non-SingleExpand mode. | |
| ToggleItem | Func<Task, TItem> | Toggles an item. |
BitComponentBase parameters
Name |
Type |
Default value |
Description |
|---|---|---|---|
| AriaLabel | string? | null | The aria-label of the control for the benefit of screen readers. |
| Class | string? | null | Custom CSS class for the root element of the component. |
| Dir | BitDir? | null | Determines the component direction. |
| HtmlAttributes | Dictionary<string, object> | new Dictionary<string, object>() | Capture and render additional attributes in addition to the component's parameters. |
| Id | string? | null | Custom id attribute for the root element. if null the UniqueId will be used instead. |
| IsEnabled | bool | true | Whether or not the component is enabled. |
| Style | string? | null | Custom CSS style for the root element of the component. |
| Visibility | BitVisibility | BitVisibility.Visible | Whether the component is visible, hidden or collapsed. |
BitComponentBase public members
Name |
Type |
Default value |
Description |
|---|---|---|---|
| UniqueId | Guid | Guid.NewGuid() | The readonly unique id of the root element. it will be assigned to a new Guid at component instance construction. |
| RootElement | ElementReference | The ElementReference of the root element. |
BitNavNameSelectors<TItem> properties
Name |
Type |
Default value |
Description |
|---|---|---|---|
| AriaCurrent | BitNameSelectorPair<TItem, BitNavAriaCurrent?> | new(nameof(BitNavItem.AriaCurrent)) | The AriaCurrent field name and selector of the custom input class. |
| AriaLabel | BitNameSelectorPair<TItem, string?> | new(nameof(BitNavItem.AriaLabel)) | The AriaLabel field name and selector of the custom input class. |
| Class | BitNameSelectorPair<TItem, string?> | new(nameof(BitNavItem.Class)) | The Class field name and selector of the custom input class. |
| ChildItems | BitNameSelectorPair<TItem, List<TItem>?> | new(nameof(BitNavItem.ChildItems)) | The ChildItems field name and selector of the custom input class. |
| CollapseAriaLabel | BitNameSelectorPair<TItem, string?> | new(nameof(BitNavItem.CollapseAriaLabel)) | The CollapseAriaLabel field name and selector of the custom input class. |
| Data | BitNameSelectorPair<TItem, object?> | new(nameof(BitNavItem.Data)) | The Data field name and selector of the custom input class. |
| Description | BitNameSelectorPair<TItem, string?> | new(nameof(BitNavItem.Description)) | The Description field name and selector of the custom input class. |
| ExpandAriaLabel | BitNameSelectorPair<TItem, string?> | new(nameof(BitNavItem.ExpandAriaLabel)) | The ExpandAriaLabel field name and selector of the custom input class. |
| ForceAnchor | BitNameSelectorPair<TItem, bool?> | new(nameof(BitNavItem.ForceAnchor)) | The ForceAnchor field name and selector of the custom input class. |
| IconName | BitNameSelectorPair<TItem, string?> | new(nameof(BitNavItem.IconName)) | The IconName field name and selector of the custom input class. |
| IsEnabled | BitNameSelectorPair<TItem, bool?> | new(nameof(BitNavItem.IsEnabled)) | The IsEnabled field name and selector of the custom input class. |
| IsExpanded | BitNameSelectorPair<TItem, bool?> | new(nameof(BitNavItem.IsExpanded)) | The IsExpanded field name and selector of the custom input class. |
| IsSeparator | BitNameSelectorPair<TItem, bool?> | new(nameof(BitNavItem.IsSeparator)) | The IsSeparator field name and selector of the custom input class. |
| Key | BitNameSelectorPair<TItem, string?> | new(nameof(BitNavItem.Key)) | The Key field name and selector of the custom input class. |
| Match | BitNameSelectorPair<TItem, BitNavMatch?> | new(nameof(BitNavItem.Match)) | The Match field name and selector of the custom input class. |
| Style | BitNameSelectorPair<TItem, string?> | new(nameof(BitNavItem.Style)) | The Style field name and selector of the custom input class. |
| Target | BitNameSelectorPair<TItem, string?> | new(nameof(BitNavItem.Target)) | The Target field name and selector of the custom input class. |
| TemplateRenderMode | BitNameSelectorPair<TItem, BitNavItemTemplateRenderMode?> | new(nameof(BitNavItem.TemplateRenderMode)) | The TemplateRenderMode field name and selector of the custom input class. |
| Text | BitNameSelectorPair<TItem, string?> | new(nameof(BitNavItem.Text)) | The Text field name and selector of the custom input class. |
| Title | BitNameSelectorPair<TItem, string?> | new(nameof(BitNavItem.Title)) | The Title field name and selector of the custom input class. |
| Url | BitNameSelectorPair<TItem, string?> | new(nameof(BitNavItem.Url)) | The Url field name and selector of the custom input class. |
| AdditionalUrls | BitNameSelectorPair<TItem, IEnumerable<string>?> | new(nameof(BitNavItem.AdditionalUrls)) | The AdditionalUrls field name and selector of the custom input class. |
BitColor enum
Name |
Value |
Description |
|---|---|---|
| Primary | 0 | Info Primary general color. |
| Secondary | 1 | Secondary general color. |
| Tertiary | 2 | Tertiary general color. |
| Info | 3 | Info general color. |
| Success | 4 | Success general color. |
| Warning | 5 | Warning general color. |
| SevereWarning | 6 | SevereWarning general color. |
| Error | 7 | Error general color. |
| PrimaryBackground | 8 | Primary background color. |
| SecondaryBackground | 9 | Secondary background color. |
| TertiaryBackground | 10 | Tertiary background color. |
| PrimaryForeground | 11 | Primary foreground color. |
| SecondaryForeground | 12 | Secondary foreground color. |
| TertiaryForeground | 13 | Tertiary foreground color. |
| PrimaryBorder | 14 | Primary border color. |
| SecondaryBorder | 15 | Secondary border color. |
| TertiaryBorder | 16 | Tertiary border color. |
BitVisibility enum
Name |
Value |
Description |
|---|---|---|
| Visible | 0 | The content of the component is visible. |
| Hidden | 1 | The content of the component is hidden, but the space it takes on the page remains (visibility:hidden). |
| Collapsed | 2 | The component is hidden (display:none). |
BitDir enum
Name |
Value |
Description |
|---|---|---|
| Ltr | 0 | Ltr (left to right) is to be used for languages that are written from the left to the right (like English). |
| Rtl | 1 | Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic). |
| Auto | 2 | Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element. |
Feedback
You can give us your feedback through our GitHub repo by filing a new Issue or starting a new Discussion.
Or you can review / edit this page on GitHub.
Or you can review / edit this component on GitHub.
- On this page