Skip to main content
Question

Use plugin to copy past item from assets


Hello everyone,

I want to create a plugin that uses items from the library within the assets section and inserts them onto the page. Is there any similar code available, or is there a part of the Figma API that allows me to view the list of libraries and their assets?

Thanks!

This topic has been closed for comments

4 replies

Gleb
  • Power Member
  • 4707 replies
  • May 26, 2024

No.

You need to know a component key to import it. You can use REST API to get component keys or ask the user navigate to the library file to get all the necessary component keys, save them in the plugin client storage and then import them in any file.


  • Author
  • 2 replies
  • May 26, 2024

many thanks. is there any sample or tutorial for this .
i got the teams components keys . how can i add this to another project on my teams using plugin.


Gleb
  • Power Member
  • 4707 replies
  • May 26, 2024

Just use the import function and then component.createInstance(). I don’t know of any tutorials, probably just learn coding basics if that’s the issue.


  • Author
  • 2 replies
  • May 26, 2024

many thank . i successfully fix my issue .


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings