New: Headless Commerce with Remix! read more

addNavMenuItem

addNavMenuItem

Add a menu item to an existing section specified by sectionId. The id of the section can be found by inspecting the DOM and finding the data-section-id attribute. Providing the before argument will move the item before any existing item with the specified id. If omitted (or if the name is not found) the item will be appended to the end of the section.

This should be used in the NgModule providers array of your ui extension module.

Example

@NgModule({
  imports: [SharedModule],
  providers: [
    addNavMenuItem({
      id: 'reviews',
      label: 'Product Reviews',
      routerLink: ['/extensions/reviews'],
      icon: 'star',
    },
    'marketing'),
  ],
})
export class MyUiExtensionModule {}
``

## Signature

```TypeScript
function addNavMenuItem(config: NavMenuItem, sectionId: string, before?: string): Provider

Parameters

config

parameter
type:
NavMenuItem

sectionId

parameter
type:
string

before

parameter
type:
string