Skip to content

[HTML]How to use an instance in a tag's attribute in Figma Connect? #206

Open
@Dang-xiaorui

Description

@Dang-xiaorui

Please provide:

  • Code Connect CLI version [use npx figma -V if using React, or figma -V otherwise, to get the version of your CLI]
  • Operating system
  • Code Connect file, Figma design and/or relevant code snippet that could help us get more context
    • If you prefer not to share those publicly please reach out via the Figma support

How to use an instance in a tag's attribute, typically refers to dynamically binding a component instance (such as an icon instance) to a property of an HTML tag in Figma Connect.
We have code like this:
iconValue:figma.children('*'),
<Button class=${props.className} :icon=${props.iconValue} hasIcon=${props.icon}> <div slot="icon">${props.iconValue}</div> </Button>

However, that displays like this with the layer name:
QQ_1730980890968

How can I get the code like this:
QQ_1730981090805

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