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

Rendering different code based on the parent component. Is it possible? #166

Open
rkieru opened this issue Sep 17, 2024 · 2 comments
Open

Comments

@rkieru
Copy link

rkieru commented Sep 17, 2024

In Figma we rely on a List primitive to output a type of UI across multiple components. So for example:

  • Select Dropdown
  • Side Navigation
  • Mobile Navigation

These 3 components may all use the List primitive. But in our SDK implementation we do not use the same component for each.

Is there a way to identify through code connect when a "List" is being consumed in "Component A" vs. "Component B" and based on that offer a different output?

@ericandrewscott
Copy link

@rkieru I had this same exact question. I gave a longer, more annoying version of this question here 😛

@ericandrewscott
Copy link

I think it would be nice if we could provide an optional param to figma.children. I could see it looking like:

children: figma.children("_ / ListItem", <DropdownListItem>),

or:

children: figma.children(["_ / ListItem", "_ / Icon"], [<DropdownListItem>, <DropdownIcon>]),

Figma friends, do you accept PRs from forks?

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

2 participants