flexlayout-react
    Preparing search index...

    Class ContextMenuBuilder

    A fluent builder for prebuilt node context menu entries: choose which actions to show (in your own order), interleave your own items, and place dividers between groups, then call ContextMenuBuilder.build to get the PopupMenuEntrys for showPopupMenu.

    const items = new ContextMenuBuilder(node)
    .add("pin")
    .add("float")
    .add("popout")
    .add("rename")
    .addDivider()
    .add("closeAll")
    .add("closeRight")
    .add("closeOthers")
    .addDivider()
    .add("close")
    .build();
    Index
    • add the prebuilt item for the given action (omitted, or included disabled, per includeDisabled)

      Parameters

      Returns this

    • add a divider between groups. Unnamed dividers get a unique key (e.g. "divider-1") so several can be added to one menu without React key collisions.

      Parameters

      • Optionalkey: string

      Returns this

    • add all the standard actions for this node type, in their default order and without dividers

      Returns this

    • Returns entries with consecutive dividers collapsed to one and any divider that ends up leading or trailing removed (a divider is only kept when it separates two other entries).

      Returns PopupMenuEntry[]