Context
Library
Updated 2 months ago ·
v1.3.7Context Menus
lib.registerContext
Register a context menu that can be opened by ID
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Unique menu identifier |
| data | table | yes | Menu definition (see below) |
Menu Data
| Field | Type | Description |
|---|---|---|
title | string | Menu header title |
icon | string | FontAwesome icon class |
options | table[] | Array of menu options |
Option Fields
| Field | Type | Description |
|---|---|---|
title | string | Option label |
description | string | Subtitle text |
icon | string | FontAwesome icon |
onSelect | function | Callback when selected |
menu | string | ID of a sub-menu to open |
dialog | string | ID of a dialog to open |
args | any | Arguments passed to clientEvent / serverEvent |
clientEvent | string | Trigger a client event when selected |
serverEvent | string | Trigger a server event when selected |
metadata | table | Key-value pairs displayed as badges |
disabled | boolean | Grey out the option |
arrow | boolean | Show a right arrow |
willClose | boolean | Force option to close (or keep open) before callbacks |
lib.openContext
Open a registered context menu
lib.closeContext
Close the currently open context menu
lib.getOpenContextMenu
Get the ID of the currently open context menu
lib.showContext / lib.hideContext
Show or hide the context menu without destroying it
Was this page helpful?
This page was last updated on 12 March 2026