Skip to main content
Question

Flipping Icons Horizontally Using Figma APIs

  • December 31, 2024
  • 1 reply
  • 16 views

Surendra_Kumar

We are working on a project where we need to flip icons horizontally using Figma APIs. Specifically, we want to change the orientation of icons from left-to-right to right-to-left for all nodes within a design file.

Could you please guide us on how to achieve this using Figma APIs? If there are any specific methods or best practices for implementing this transformation, we would greatly appreciate your input.

Thank you for your assistance, and we look forward to your guidance.

1 reply

tank666
  • 4863 replies
  • January 15, 2025

To flip nodes, you need to change the transformation matrix provided by the relativeTransform property.

For example, to flip horizontally, you can use this code:

node.relativeTransform = [
  [-1, 0, x],
  [0, 1, y]
]

 


Reply


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