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

Can I combine string and children values and map them to one property? #92

Open
alisonjoseph opened this issue Jul 8, 2024 · 3 comments

Comments

@alisonjoseph
Copy link

titleItem: figma.nestedProps('_Contained list title item', {
  label: figma.boolean('Tooltip', {
    true: figma.string('List title text') + figma.children('Tooltip'), <--how can I do this?
    false: figma.string('List title text'),
  }),
}),
@Chanki-Min
Copy link

In this stage of code-connect (v 1.0.6) it is not possible. but we can get same results with variant restriction.

see this -> #80 (comment)

@alisonjoseph
Copy link
Author

alisonjoseph commented Sep 4, 2024

@Chanki-Min I'm not sure variant restrictions would help me here since its a nested prop, unless I missed something and variant restrictions support nesting.

@higuchimmy
Copy link

higuchimmy commented Sep 18, 2024

+1

@Chanki-Min
In my case, there are multiple nested components that I want to display based on specific boolean conditions.
I'd like this feature to be supported.

accentButton: figma.boolean('accentButton', {
  true: figma.nestedProps('Button', {
    variant: figma.enum('variant', {
      normal: 'normal',
      outlined: 'outlined',
    }),
  }) + figma.nestedProps('ButtonContent', {
    label: figma.string('label'),
  }), // Please support this case.
  false: {
    variant: undefined,
    label: undefined,
  },
}),

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

No branches or pull requests

3 participants