Skip to main content
elcicneha
New Participant
January 31, 2025
Solved

How to rerun the plugin without UI

  • January 31, 2025
  • 1 reply
  • 213 views

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?

This topic has been closed for replies.
Best answer by tank666

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__);

 

1 reply

tank666
tank666Answer
January 31, 2025

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__);

 

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