Skip to content

Accessing Instance props (getProps) when using figma.children() #247

Open
@blabute

Description

@blabute

Good day!

Similar to #215, our designer is also using Icons as children instead of instance swap properties.
Is it possible to use the getProps on this result to get the properties of this mapped instance?

Figma

Image

What I'd like to do

figma.children('*').getProps<{ name: string }>()

Similar to

figma.instance('icon').getProps<{ name: string }>()

Note: when there is an instance swap property, figma.instance('icon').getProps<{ name: string }>() does work but this specific component in Figma does not have one.

What it looks like now

<Badge icon={<Icon icon="IconName" size={16} />} />

What I would like it to be

<Badge icon="IconName" />

Please provide:

  • Code Connect CLI version [use npx figma -V if using React, or figma -V otherwise, to get the version of your CLI]
    • 1.2.4
  • Operating system
    • macOS 15.2 (25C101)

Thanks for the help!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions