code-connect icon indicating copy to clipboard operation
code-connect copied to clipboard

Map multiple figma properties to a single Compose parameter

Open dianasu-collab opened this issue 4 months ago • 0 comments

Our designers frequently use 2 figma properties to configure a single optional field. For example, one boolean property indicating whether the field should be shown, and a text property indicating the text value when the field is shown. This corresponds to a single nullable parameter on the Compose side. Would you consider adding this functionality to Code Connect CLI? For example, maybe something like the following where one property can reference a previously defined property?

@FigmaProperty(FigmaType.Text, "Label text")
public val labelText: String = "{label text}"

@FigmaProperty(FigmaType.Boolean, "Optional label")
public val optionalLabel: String? = Figma.mapping(
   true to labelText,
   false to null,
)

dianasu-collab avatar Oct 23 '25 19:10 dianasu-collab