Menu api
NbMenuComponent
Inputs
| Name | Type | Description |
| items | NbMenuItem[] | List of menu items. |
| tag | string | Tags a menu with some ID, can be later used in the menu service to determine which menu triggered the action, if multiple menus exist on the page. |
| autoCollapse | boolean | Collapse all opened submenus on the toggle event Default value is "false" |
NbMenuItem
Properties
| Name | Type | Description |
| badge | NbMenuBadgeConfig | Badge component |
| children | NbMenuItem[] | Children items |
| expanded | boolean | Expanded by default |
| group | boolean | Whether the item is just a group (non-clickable) |
| hidden | boolean | Hidden Item |
| home | boolean | Where this is a home item |
| icon | Icon class name or icon config object | |
| link | string | Item relative link (for routerLink) |
| pathMatch | Item is selected when partly or fully equal to the current url | |
| queryParams | Params | Map of query parameters |
| skipLocationChange | boolean | Whether the item skipLocationChange is true or false |
| target | string | HTML Link target |
| title | string | Item Title |
| url | string | Item URL (absolute) |
NbMenuService
Methods
| Name | Description |
| addItems() | parameters: items: returns:NbMenuItem[], tag: stringvoidAdd items to the end of the menu items list |
| collapseAll() | parameters: tag: returns:stringvoidCollapses all menu items |
| getSelectedItem() | parameters: tag: returns:stringObservable<NbMenuBag>Returns currently selected item. Won't subscribe to the future events. |
| navigateHome() | parameters: tag: returns:stringvoidNavigate to the home menu item |
Need some help or found an issue?
Ask on Stack Overflow with tag `nebular` or post an issue on GitHub.
