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