Skip to content

Map multiple figma properties to a single Compose parameter #334

@dianasu-collab

Description

@dianasu-collab

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,
)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions