mljr-ui · showcase

Context Menu

Right-click context menu anchored to the cursor. Closes on click-outside, Escape, or item selection.

overlay context-menu

Usage

// 1. Attach to any element via data-ctx
h.Div(g.Attr("data-ctx", "my-menu"), g.Text("Right-click me"))

// 2. Render the menu (place anywhere on page)
overlay.ContextMenu(overlay.ContextMenuProps{
    ID: "my-menu",
    Items: []overlay.ContextMenuItem{
        {Label: "Edit",   Icon: "lucide:edit",   OnClick: "editItem()"},
        {Label: "Share",  Icon: "lucide:share",  OnClick: "shareItem()"},
        {Separator: true},
        {Label: "Delete", Icon: "lucide:trash-2", OnClick: "deleteItem()"},
    },
})