Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Dang-xiaorui opened this issue Nov 7, 2024 · 3 comments
Open

Comments

@Dang-xiaorui
Copy link

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

@Dang-xiaorui Dang-xiaorui changed the title How to use an instance in a tag's attribute in Figma Connect? [HTML]How to use an instance in a tag's attribute in Figma Connect? Nov 7, 2024
@ptomas-figma
Copy link
Collaborator

Hi! There seems to be two things at play here:

  • The "Code Connect Error" string. This seems like a bug on our side that we'll investigate and fix in a future version.
  • Support for rendering the icon name in the example. This is is something we recently added support on the React API (here) but isn't not supported at the moment by the HTML one.

@Dang-xiaorui
Copy link
Author

So, will you support for rendering the icon name on the HTML API in the future? When is it expected to be supported?

@slees-figma
Copy link

Hi @Dang-xiaorui, we don't have a timeline to share on icon support in the HTML API right now - as we've just released for React we'd like to review how this has been received before implementing it for other frameworks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants