Add component property
figma_add_component_propertyAdds a text, boolean, instance-swap, or variant property to a Figma component or component set, letting instances edit labels, toggle layers, swap icons, or choose variants.
Instructions
Give a component (or component set) a property that instances can change: TEXT (wire it to text layers with bindNodeIds — instances then edit the label without detaching), BOOLEAN (show/hide the bound layers), INSTANCE_SWAP (swap a nested icon instance; default = a component id), VARIANT (on a set only). Returns the property key (name + #id) that figma_set_instance_properties accepts — the plain name works too. Called again with a name and type that exist, it reuses that property (reused: true) and wires the new layers; to rename, re-default or unwire use figma_edit_component_property. A slot is figma_create_slot. Editors: Design; unverified: FigJam, Slides.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | e.g. "Label", "Show icon". | |
| type | Yes | ||
| session | No | Optional sessionId or file name, to pick a Figma file when more than one is connected. | |
| bindNodeIds | No | Layers inside the component this property drives. | |
| componentId | Yes | A COMPONENT, or a COMPONENT_SET — not a single variant inside a set. | |
| defaultValue | Yes | Text, "true"/"false" for BOOLEAN, a component id for INSTANCE_SWAP. | |
| idempotencyKey | No | Caller-owned retry key, ≤128 chars. Re-calling with the same key never executes twice: it returns the existing result, or waits for the op still in flight. Supply your own for anything large — if the MCP client times out (rather than the bridge), only a key you chose can be used to retry safely. | |
| preferredValues | No | INSTANCE_SWAP only: component or component-set ids offered first in the swap menu. |