Defining children for items of the "Context Menu" component

I don’t know if I recall correctly, but I remember being able to define children of the items in the Context Menu component. Or maybe a different componen. I tried several property names like children, items, etc. but it doesn’t seem to do anything. Nothing in the docs as well, so I might be experiencing the Mandela effect.

Hi @Max

You’re remembering a real capability, but likely from a different component. The regular Menu and Horizontal Menu components support nested items via children.

The Context Menu Button component does not currently support nested menu items. Its supported item shape is flat:

{
  id: string;
  title?: string;
  icon?: string;
  onlyIcon?: boolean;
}

So properties like children, items, or similar won’t render submenus. They may remain in the clicked item’s data, but the renderer does not pass them to the actual menu UI.

Practical options:

  • Use Menu or Horizontal Menu if you need true nested children.
  • Flatten the Context Menu Button items.
  • For a custom drill-down behavior, handle On Item Click and call setMenuItems(...) with the next level of items manually.
1 Like

Ah, that’s what it was, I thought I’m going insane! Thank you Kate as always.