Skip to main content
July 25, 2023
Solved

Is there a way to create widget instance using API?

  • July 25, 2023
  • 3 replies
  • 549 views

Without the user interaction, is there a way to create a widget instance?

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

The plugin cannot create WidgetNodes. The only possible way is to clone already existing nodes in the file.

3 replies

tank666
July 25, 2023

Find the widget in the document and clone it.

figma.com
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
vegetaAuthor
July 25, 2023

Sorry, I meant how to create the first instance i.e. if the document doesn’t have a widget yet.
For example, if the selection has changed, I want to insert an instance. How do I achieve that?

tank666
tank666Solution
July 25, 2023

The plugin cannot create WidgetNodes. The only possible way is to clone already existing nodes in the file.

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