Pushing objects out of the way when an interactive component "expands"

I have a search button that turns into a field on click. I’d like the field to be wider than the button and to push the objects beside it out of the way when it expands. I’d like the se4arch button/field to be an instance of a component with two variants, one for each state resting and expanded).

Unfortunately, I can’t get the size of the component instance to change when used in a different file. I’ve tried setting both the component and the instance to “Hug”, but to no avail.

Here’s a video of a similar interaction from Monday.com:


PS. I don’t know how to embed a demo Figma file here… sorry about that.

@Jason_Carlin This can be achieved with a combination of Auto Layout and Interactive Components. I made an example here for you. Make sure to go to Prototype Mode and check it out.


Thank you!

But the problem arises when the search component is located in a different file from the instance. I’m still having this problem, unfortunately.

@Jason_Carlin Odd. I moved the component to a different library, and only used the instance in the demo file, and it still works. Have a look: https://www.figma.com/file/06iZsoCKLqSf4rcTlkCv6U/Figma-Forum%3A-Pushing-objects-out-of-the-way?node-id=0%3A1&t=32i1Pw8MHQxRYuC2-1

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