Swap library nested components?

My team would like to have a set of high fidelity components and low fidelity components and be able to swap between them. We’ve already got our high fidelity set, so my bright idea was to duplicate that file, tweak the components to low-fi, and then use Swap Library to move back and forth between them.

That SORT OF works, except when a 3rd library comes into play.

I have something like this:

Library A (high fidelity) → Button component
Library B (also high fidelity, product specific) → Card component that uses Button from A
Library C (low fidelity copy of A) → Button component

When I swap A → C, any Button components inserted directly from A will swap. Any Buttons in the Card component will not swap, even though they are also from A.

This is an oversimplified example, I’ve got lots of components in library B that aren’t swapping their A components.

I assumed (obviously wrong) that if I swapped out Library A, it would swap it regardless of being nested in other libraries.

It seems like the workaround would be to create a copy of Library B, swap the components A->C, publish that as Library D, and then swap out A->C and B->D in the original file. That seems like a lot of work.

Am I making any sense? Is there an easier way to do this?

1 Like

I don’t completely follow you, but I believe I have a similiar problem.

I would also like to have nested component being swapped.

My example:
In the main lib I have a header with a nested logo.

When I swap for brand variant I would like the header to update the nested logo(main) with logo(brand variant) without having to include the header component in brand variant lib.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.