set_variant
Modify component sets in Figma by creating, adding, renaming, deleting, organizing, or batch processing variants/properties. Supports single or batch operations for efficient design updates.
Instructions
Create, add, rename, delete, organize, or batch create variants/properties in a component set (single or batch).
Returns: Array of result objects for each operation.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
variant | No | A single variant operation to perform. | |
variants | No | An array of variant operations to perform in batch. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"variant": {
"additionalProperties": false,
"description": "A single variant operation to perform.",
"properties": {
"action": {
"description": "The action to perform on the component set.",
"enum": [
"create",
"add",
"rename",
"delete",
"organize",
"batch_create"
],
"type": "string"
},
"componentSetId": {
"description": "The ID of the component set to operate on.",
"type": "string"
},
"newPropertyName": {
"description": "The new name for the property (if renaming).",
"type": "string"
},
"newPropertyValue": {
"description": "The new value for the property (if changing).",
"type": "string"
},
"organizeBy": {
"description": "Properties to organize variants by.",
"items": {
"type": "string"
},
"type": "array"
},
"properties": {
"additionalProperties": {
"type": "string"
},
"description": "Additional properties for the variant operation.",
"type": "object"
},
"propertiesList": {
"description": "A list of property objects for batch operations.",
"items": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"type": "array"
},
"propertyName": {
"description": "The name of the property to rename or modify.",
"type": "string"
},
"propertyValue": {
"description": "The value of the property to set or update.",
"type": "string"
},
"templateComponentId": {
"description": "The ID of a template component to use for batch creation.",
"type": "string"
},
"variantId": {
"description": "The ID of the specific variant to modify (if applicable).",
"type": "string"
}
},
"required": [
"componentSetId",
"action"
],
"type": "object"
},
"variants": {
"description": "An array of variant operations to perform in batch.",
"items": {
"$ref": "#/properties/variant"
},
"type": "array"
}
},
"type": "object"
}