Skip to main content
Jul 25, 2023 7:17 AM UTC
Solved

Is there a way to create widget instance using API?

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

This topic has been closed for replies.
tank666
tank666Solution
Jul 25, 2023 10:12 AM UTC

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

3 replies

tank666
Jul 25, 2023 7:48 AM UTC

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
Jul 25, 2023 8:38 AM UTC

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
Jul 25, 2023 10:12 AM UTC

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