Skip to main content
Solved

Is it possible to update the children of an existing component using the plugin API?


Derek_Watson

Is it possible to update the children of an existing component using the plugin API?

I am working on a plugin that generates icon components for a library from raw SVGs. The generation part is pretty straightforward, but I’d also like to be able to update the existing Figma components when there are changes to the SVGs without breaking the component instances.

The children property is readonly and I haven’t been able to find another way to remove the existing children of the ComponentNode so that I can add the updated children. Is there something I missed?

Best answer by tank666

Call remove() on the child node you want.

figma.com
View original
This topic has been closed for replies.

2 replies

tank666
  • 4873 replies
  • Answer
  • March 13, 2024

Call remove() on the child node you want.

figma.com

Derek_Watson

Thanks! I actually just figured it out 😅 Don’t know why I struggled with that one for so long.


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