AboutSupportDeveloper GuideVersion 38.126.82.64

Interface ShowPopupMenuOptions<Data>

Options for showing a popup menu

interface ShowPopupMenuOptions<Data> {
    template: MenuItemTemplate<Data>[];
    x?: number;
    y?: number;
}

Type Parameters

  • Data extends unknown = unknown

    User-defined shape for data returned upon menu item click. Should be a union of all possible data shapes for the entire menu, and the click handler should process these with a "reducer" pattern.

Properties

Properties

template: MenuItemTemplate<Data>[]

An array describing the menu to show.

x?: number

The window x coordinate where to show the menu. Defaults to mouse position. If using must also use y.

y?: number

The window y coordinate where to show the menu. Defaults to mouse position. If using must also use x