TabAddMenu
Headless "add tab" menu that lists available tab types for a panel.
TabAddMenu is a headless component that computes the list of tab types available to add to a panel and hands it to your render prop. It does no UI — pair it with any popover or dropdown library you already use.
Props
panelId (required)
The panel to add tabs to. Must match a PanelNode id in the layout tree.
render (required)
Called with the list of available items. Render whatever UI you want — a dropdown, a popover, a context menu:
alreadyAdded is provided so you can grey out or hide types already present — the library doesn't enforce this, it's your call.
filter
Additional filter applied on top of the default. The default already excludes entries where availableInAddMenu === false. Use filter to narrow further — for example, show only entries relevant to a particular panel role:
Registry integration
TabAddMenu reads the registry automatically. For a tab type to appear in the menu:
- Its registry entry must not have
availableInAddMenu: false(the default istrue/ included). - It must not be filtered out by the
filterprop.
When the user picks an item, add() calls the entry's createDescriptor() if defined — use this to generate a fresh id or populate default meta:
Full example with a popover
Pass this as the trailing slot on TabList: