---
title: "Adding a Single Context Menu Entry"
slug: "adding-a-single-context-menu-entry-1"
description: "Add a single context menu entry using the NavVis IVION Frontend API"
updated: 2026-02-26T14:43:51Z
published: 2026-02-26T14:43:51Z
canonical: "knowledge.navvis.com/adding-a-single-context-menu-entry-1"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://knowledge.navvis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Adding a Single Context Menu Entry

To include one context menu entry, the override method should return a [ContextMenuEntry](https://ivion-api.docs.navvis.com/latest/reference/interfaces/contextmenuentryinterface.html) object. The properties for a valid `ContextMenuEntry` are:

| name | The text that appears in the menu |
| --- | --- |
| icon | An icon ligature name that appears next to the name |
| callback | The function that is triggered when a user clicks or presses the entry |

Run the following to add a single context menu entry:

```plaintext
// SampleContextMenuEntryLayer.ts
import {
  ContextMenuEntryInterface, CustomLayer,
  MouseEventCoordinatesInterface
} from "@navvis/ivion";

export class SampleContextMenuEntryLayer extends CustomLayer
{
  public onContextMenu(pos: MouseEventCoordinatesInterface): ContextMenuEntryInterface
  {
    //return the ContextMenuEntryInterface
    return {
      name: "Go to Navvis",
      icon: "fa-globe",
      callback: () =>
      {
        window.open("https://www.navvis.com")
      }
    }
  }
}
```
