Skip to main content
Solved

Border variable with nested components & instance swaps

  • October 26, 2023
  • 1 reply
  • 358 views

Adrian19

Hello, I’m having an issue where I have a generic button with an icon using an instance swap.

I created a border variable and tied it to the layer.

I then created a nested component with that original, made variants, changed the icons, and set up the interaction with “set variable”

When the border changes, it changes for both buttons.

Figma_mLqtHwBBhU

How should I be making buttons with icons & variable interactions so this doesn’t happen and doesn’t become buggy later?

example file

Best answer by djv

Hey @Adrian19, thanks for reaching out!

This is expected if you bind the variable at the main component level — it will apply to all instances.

Be sure to only use this button for the overlay interaction or add the interaction to the instance, not the component to prevent this from happening.

View original
This topic has been closed for replies.

djv
Figmate
  • Community Support
  • November 1, 2023

Hey @Adrian19, thanks for reaching out!

This is expected if you bind the variable at the main component level — it will apply to all instances.

Be sure to only use this button for the overlay interaction or add the interaction to the instance, not the component to prevent this from happening.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings