Skip to main content
Question

Can I mark a component as "added from my plugin whin these parameters" in components data and expose these parameters to project viewers?

  • September 19, 2022
  • 7 replies
  • 423 views

shenpengfei

I new to figma plugins, and I want to make a component plugin both for designer and developers, designer can chose parameters in figma plugin to generate a component, developer can get those parameters as viewer of this figma project, and use them directly in code project with the library I provided.
Is this possible with plugin API? or how can I do this in other ways?

7 replies

shenpengfei
  • Author
  • 6 replies
  • September 20, 2022

I found setPluginData method in plugin api docs, but how can I expose those data to viewers?


tank666
  • 4863 replies
  • September 20, 2022

Viewers cannot run plugins/widgets at this time.

Figma Help Center

shenpengfei
  • Author
  • 6 replies
  • September 20, 2022

I knew, but can I serialize my parameters to string and store them to somewhere like component description or something similar to let viewers copy them?


shenpengfei
  • Author
  • 6 replies
  • September 20, 2022

Maybe a redundant group and use it name to store them?


Gleb
  • Power Member
  • 4706 replies
  • September 20, 2022

Sure, both of these approaches would work fine.


tank666
  • 4863 replies
  • September 20, 2022

Yes, you can write your parameters in the component description. But editors can remove/change it.

figma.com

shenpengfei
  • Author
  • 6 replies
  • September 21, 2022

Thanks, I’ll try this first.


Reply


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