set_component_property
Add a Boolean, Text, Instance Swap, or Variant property to a Figma component or component set. Specify default values and link instance swap properties.
Instructions
Add a Component Property (Boolean, Text, Instance Swap, or Variant) to a Component or ComponentSet. For INSTANCE_SWAP: defaultValue must be the component KEY (not node ID), and targetChildId should be the child Instance node whose mainComponent will be linked.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | Component or ComponentSet node ID | |
| defaultValue | No | Default value. For INSTANCE_SWAP: use component KEY string (not node ID) | |
| propertyName | Yes | Property name (e.g. 'Show Icon', 'Label', 'icon') | |
| propertyType | Yes | Property type | |
| targetChildId | No | For INSTANCE_SWAP: the child Instance node ID to link. Sets componentPropertyReferences.mainComponent automatically |