Menu service
Live provides an API to register new menu items at navigation bar.
Standard API
Since Live @ 2
Menu service
The menuService is a javascript module that allows registering custom menu items to Live navigation bar or an item that already exists at the navigation bar. Every menu item must have a unique name and alias to represent itself.
How to import
Methods
register(menu: MenuItem, type: MenuType): void
Register a new menu item.
unregister(menu: MenuItem, type: MenuType): void
Unregister an already existing menu item.
getAll(): MenuItems
Obtain all registered menu items.
withMenuItems(Component: React.ComponentType<{ menus: MenuItems }>): React.FC
Allow a React component to receive all listed menus.
Menu Item Base
The base properties that are commom between all types of menu are explained in more detail in the table below:
Menu Right Item
The 'right' type menu has the component
property instead of the Component
described before. It also have the same properties, with an extra described as follows:
Menu Preferences Item
The preferences menu has some extra properties that are described down below:
Menu Console Item
The console menu has the same component
, name
, url
, onClick
, icon
and description
described above, but have its own particularities. See the table below to know about the extra properties of it:
Examples
Regular menu example:
Regular menu with selectedAliases:
Regular menu with replaces:
Right menu example:
Preferences menu example:
Console menu example:
Last updated