Develop Secure Code
ui*Api Supported Objects
getNavItems (Beta)
getNavItems (Beta)Use this wire adapter to retrieve the items in the navigation menu.
1import { LightningElement, wire } from 'lwc';
2import { getNavItems } from 'lightning/uiAppsApi';
3import FORM_FACTOR from '@salesforce/client/formFactor';
4
5export default class Example extends LightningElement {
6 @api tabs = ['standard-Account', 'standard-CollaborationGroup'];
7 @wire(getNavItems, {
8 formFactor: FORM_FACTOR,
9 navItemNames: '$tabs',
10 pageSize: 30,
11 })
12 propertyOrFunction;1GET /ui-api/nav-items/getNavItems uses this User Interface API resource.
| Parameter Name | Type | Description | Required? |
|---|---|---|---|
formFactor | String | The response includes navigation items that support this form factor.
formFactor, use the @salesforce/client/formFactor module. | |
navItemNames | String[] | A comma-delimited list of TabDefinition name values to include in the response. If navItemNames isn’t specified, the response includes all the navigation items for the specified formFactor. | |
page | Integer | The page offset from which to begin returning nav items. The default value is 0, which returns nav items from the first page. For example, for page=2 and pageSize=10, the first item returned is the 21st item in the list. | |
pageSize | Integer | The maximum number of nav items to return on a page. The default value is 25. |
Read the data that’s returned by the wire adapter using a property or function.
propertyOrFunction—A private property or function that receives the stream of data from the wire service.
@wire, the results are returned to the property’s data property or error property.@wire, the results are returned in an object with a data property and an error property.data—Nav Itemserror—FetchResponse