Skip to main content

I’ve used multiple plugins where after you run it the first time, there comes an option on the right sidebar to rerun the plugin, but this time it runs with the previous settings, without launching the UI. 

How can I add that functionality in my plugin?

To add a relaunch button in Figma UI, you need to add a manifest.relaunchButtons array with commands, then use the plugin code to set it to some node using the setRelaunchData() method and write code for the relaunch button command handler.

For example:

manifest.json

{
"relaunchButtons": [
{
"command": "relaunch",
"name": "Relaunch"
}
],

}

code.js

figma.root.setRelaunchData({relaunch: ''});

if (figma.command === 'relaunch') {
// do something
}
else figma.showUI(__html__);