g3-toolkit API Reference
    Preparing search index...

    Interface MenuItem

    A single menu item.

    interface MenuItem {
        action: (target: MenuTarget) => void;
        dynamicLabel?: (target: MenuTarget) => string;
        filter?: (target: MenuTarget) => boolean;
        icon?: string;
        id: string;
        label: string;
        separator?: boolean;
        submenu?: MenuItem[];
    }
    Index

    Properties

    action: (target: MenuTarget) => void

    Action to invoke when clicked.

    dynamicLabel?: (target: MenuTarget) => string

    Optional per-target label. When present, resolve() materializes the final label from the right-clicked target (e.g. "Copy IRI" vs "Copy ID" depending on the element's id shape); label remains the static fallback.

    filter?: (target: MenuTarget) => boolean

    Optional filter: if provided, the item only appears when filter returns true for the current target.

    icon?: string

    Optional icon (CSS class or emoji).

    id: string

    Unique identifier for this item.

    label: string

    Display label.

    separator?: boolean

    If true, show a separator line before this item.

    submenu?: MenuItem[]

    Optional submenu items.