context-menu was introduced in version 4.57.0 of the JourneyApps Runtime.
The context-menu is accessible via the ‘more’ icon on the right-hand-side of the app title bar.
context-menu should be used to display contextual items or actions relevant to the current view. Items that are relevant to the app globally (e.g. About, Messages, selecting a different language) should rather be displayed in the navigation drawer.
Referencing the image above, a context-menu consists of:
Non-customizable app items, which are provided by the JourneyApps Runtime
Basic Example
main.view.xml
<context-menu> <itemlabel="Video Tutorials"on-press="$:navigate.link('video_tutorials')" /> <itemlabel="FAQ"on-press="$:navigate.link('faq')" /><!-- A `divider` element will automatically be added to separate the above items --><!-- from non-customizable app items, e.g. 'Diagnostics' --></context-menu>
Standard Attributes
None
Advanced Attributes
from-js
Optional
Default: unset
Construct a context-menu from JavaScript/TypeScript using a $:function that returns a contextMenu object.