In order to create a variable category-based-function part or for similar logic uses two components would be needed.
- A toggle component similar to
CommandToggle but allows to be set for the part category to be checked for existence.
- A toggle component which sets the part's category based on above.
1 and 2 could be merged into one component but like CommandToggle there may be separate uses.
I admit currently these don't have much uses yet. I can only think of one or two cases where both would be needed. 1 probably has the most usability.
Edit: I expect the part to have one (last) category which is the default. And when changing category the "last" in the list would be overridden.