Figma Support Forum

Retrieve COMPONENT_SET for variants

Trying to figure out how to retrieve the COMPONENT_SET to which a component/variant belongs to.

“masterComponent” will give me the name for the variant… also the type is INSTANCE, what is the best way do I identify that an INSTANCE is also variant?


Yeah @Gleb, it will be a combination of:

if (element.type === 'INSTANCE' + :has(variantProperties)) {
    get (

Something like that…

One observation the “instance.mainComponent.parent” will be of type “COMPONENT”… but if I click the component wrapper itself for the variants the type is “COMPONENT_SET”… not sure if that is by design, but it would be good if they match



That’s weird. Maybe it’s a bug in Node Inspector plugin? Have you tried using the console?


For me this yields "COMPONENT_SET" when the selected object is the variant set instance.

You are right, I will reach out to the plugin developer, thanks