Skip to main content
Answer

Matching elements across Frames

  • November 26, 2024
  • 5 replies
  • 67 views

Malthe_Gram

Hi.

Is there some way that I can know that certain elements are the same across Frames?

Example wise, the red rectangles on the left, needs to be the same across frames, but they don’t share ID, or anything else, besides possibly the name.

Is there any way to match these elements?

Thank you in advance.

Best answer by tank666

Yes, you can write a function that will check the properties for compliance, for example, name, width, height, fills, fillStyleId, etc. of the objects you need.

This topic has been closed for replies.

5 replies

tank666
  • Answer
  • November 26, 2024

Yes, you can write a function that will check the properties for compliance, for example, name, width, height, fills, fillStyleId, etc. of the objects you need.


Malthe_Gram
  • Author
  • November 26, 2024

@tank666 This was also my original thought. However as the elements can be placed differently, and have different height and width values, based on their format, these data can differ.


tank666
  • November 26, 2024

Since the properties of these elements are different (not the same), then we can consider that they are different elements.


Malthe_Gram
  • Author
  • November 26, 2024

@tank666 I understand that’s how you see, and Figma aswell, but thats not the case for my needs.


tank666
  • November 26, 2024

In that case, I think you need to decide for yourself what criteria to use to detect matches. Perhaps, in addition to the name (which can be changed by the user), you should check the node type (frame, rectangle, vector, instance, etc.). If the node is an instance, you can check its main component.