Context Menu Item Actions Template
The Context Menu ItemActionsTemplate renders optional trailing content in each item, for example, a keyboard shortcut, metadata, or a hint. The Context Menu renders this content after the item text and description, and before the expand arrow of items with children.
The template receives an ItemActionsTemplateContext<TItem> object as its context. The object exposes the following properties:
| Property | Type | Description |
|---|---|---|
Item | TItem | The data item of the current Context Menu item. |
Index | string | The position of the item in the data hierarchy. The indexes of the different levels are joined by an underscore. For example, "1_3" is the fourth child of the second root item. The value counts group headers and separators, so it is unique across the ItemActionsTemplate and the GroupHeaderTemplate. |
The ItemActionsTemplate works independently of the ItemTemplate. The ItemTemplate replaces only the default icon and text of the item.
The Context Menu does not provide keyboard navigation for the content of the
ItemActionsTemplate. Use the template for informational content, such as shortcuts, rather than for interactive elements.
Show keyboard shortcuts and descriptions in the Context Menu items