Hello, I am new to Figma and I try to create a new plugin. One of the functionalities of the plugin is to switch the variant of a component. Is it possible via the API?
Page 1 / 1
In the API, each variant is simply a regular component. So to switch them, you simply need to change the mainComponent
of an instance to a different component. But you will lose all overrides. 🙁
Code example here: How to update single component attribute or variant via plugin? - #2 by Gleb
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.