Dynamically set width of component instance based on another instance

I would like to be able to dynamically set the width of multiple component instances based on the width of a base (or reference) instance.

Example: given multiple horizontal content tabs with text labels of varying lengths, I’d like have all tabs match the width of the longest label, but solely dependent upon the label length, not relevant to the container or depending upon auto-layout.

I think you can achieve that by creating a “stretcher” component and placing it inside the component for the instances you want to stretch and the reference variance.

If that doesn’t make sense to you, please share an example file showing the structure of the component you are working on and I’ll take a look

Hey Saulo! Thanks for the quick reply. I have managed to achieve your suggestion, I think. but I also need to make the resulting fig frame into a component, such that a user could pull this overarching component from the library and specify which tab element (instance) should be the base and have the other tab instances match that base width.

I don’t think this is currently possible, because as soon as I convert the frame into a component, the base/reference tab master component is converted to an instance and the master component is ejected from the main component. Apparently I cannot attach a .fig file here. Cannot post a link as corporate guidelines prohibit that.

Any super-secret tricks to maintain an embedded master component?

Thanks,
~bryan