Skip to main content
Surendra_Kumar
December 31, 2024
Question

Flipping Icons Horizontally Using Figma APIs

  • December 31, 2024
  • 1 reply
  • 90 views

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.

This topic has been closed for replies.

1 reply

tank666
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]
]

 

UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank