code-connect
code-connect copied to clipboard
Can I combine string and children values and map them to one property?
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'),
}),
}),
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 -> https://github.com/figma/code-connect/issues/80#issuecomment-2200476356
@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.
+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,
},
}),
Any updates on this 👀