set_text_style
Modify text styles in Figma by adjusting properties like font, size, weight, spacing, case, and decoration. Use node IDs to apply changes to specific text elements, returning updated content.
Instructions
Sets one or more text style properties (font, size, weight, spacing, case, decoration, etc.) on one or more nodes in Figma. Returns:
content: Array of objects. Each object contains a type: "text" and a text field with the update result.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
entries | No | Array of text style update entries. Must contain 1 to 100 items. | |
nodeId | No | The unique Figma text node ID to update. Must be a string in the format '123:456' or a complex instance ID like 'I422:10713;1082:2236'. | |
styles | No | Text style properties object - includes all Figma Plugin API supported properties (updated with corrected truncation support) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"entries": {
"description": "Array of text style update entries. Must contain 1 to 100 items.",
"items": {
"additionalProperties": false,
"description": "A single text style update entry with nodeId and styles",
"properties": {
"nodeId": {
"$ref": "#/properties/nodeId"
},
"styles": {
"$ref": "#/properties/styles"
}
},
"required": [
"nodeId",
"styles"
],
"type": "object"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"nodeId": {
"description": "The unique Figma text node ID to update. Must be a string in the format '123:456' or a complex instance ID like 'I422:10713;1082:2236'.",
"type": "string"
},
"styles": {
"additionalProperties": false,
"description": "Text style properties object - includes all Figma Plugin API supported properties (updated with corrected truncation support)",
"properties": {
"fills": {
"description": "Array of fill objects - fully supported by Plugin API",
"type": "array"
},
"fontColor": {
"additionalProperties": false,
"description": "Font color as RGBA object - implemented via fills property",
"properties": {
"a": {
"description": "Alpha channel (0-1)",
"maximum": 1,
"minimum": 0,
"type": "number"
},
"b": {
"description": "Blue channel (0-1)",
"maximum": 1,
"minimum": 0,
"type": "number"
},
"g": {
"description": "Green channel (0-1)",
"maximum": 1,
"minimum": 0,
"type": "number"
},
"r": {
"description": "Red channel (0-1)",
"maximum": 1,
"minimum": 0,
"type": "number"
}
},
"required": [
"r",
"g",
"b"
],
"type": "object"
},
"fontName": {
"anyOf": [
{
"maxLength": 100,
"minLength": 1,
"type": "string"
},
{
"additionalProperties": false,
"description": "Font name object with family and style",
"properties": {
"family": {
"description": "Font family name",
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"style": {
"description": "Font style (e.g., 'Regular', 'Bold', 'Italic')",
"maxLength": 100,
"minLength": 1,
"type": "string"
}
},
"required": [
"family",
"style"
],
"type": "object"
}
],
"description": "Font name as string (family name) or object with family and style"
},
"fontSize": {
"description": "Font size in pixels. Must be between 1 and 200.",
"maximum": 200,
"minimum": 1,
"type": "number"
},
"fontWeight": {
"description": "Font weight. Must be between 100 and 1000.",
"maximum": 1000,
"minimum": 100,
"type": "number"
},
"letterSpacing": {
"additionalProperties": false,
"description": "Letter spacing with value and unit",
"properties": {
"unit": {
"description": "Letter spacing unit",
"enum": [
"PIXELS",
"PERCENT"
],
"type": "string"
},
"value": {
"description": "Letter spacing value",
"type": "number"
}
},
"required": [
"value",
"unit"
],
"type": "object"
},
"lineHeight": {
"anyOf": [
{
"description": "Line height as multiplier (e.g., 1.6)",
"type": "number"
},
{
"additionalProperties": false,
"description": "Line height with value and unit",
"properties": {
"unit": {
"description": "Line height unit",
"enum": [
"PIXELS",
"PERCENT",
"AUTO",
"MULTIPLIER"
],
"type": "string"
},
"value": {
"description": "Line height value",
"type": "number"
}
},
"required": [
"value",
"unit"
],
"type": "object"
}
],
"description": "Line height as number or object with value and unit"
},
"maxLines": {
"description": "Maximum number of lines for text truncation - only works when textTruncation is 'ENDING'",
"minimum": 1,
"type": "number"
},
"paragraphSpacing": {
"description": "Paragraph spacing in pixels. Must be between 0 and 1000.",
"maximum": 1000,
"minimum": 0,
"type": "number"
},
"textAlignHorizontal": {
"description": "Horizontal text alignment - Plugin API supported",
"enum": [
"LEFT",
"CENTER",
"RIGHT",
"JUSTIFIED"
],
"type": "string"
},
"textAlignVertical": {
"description": "Vertical text alignment - Plugin API supported",
"enum": [
"TOP",
"CENTER",
"BOTTOM"
],
"type": "string"
},
"textAutoResize": {
"description": "Text auto-resize behavior - Plugin API supported with 4 options",
"enum": [
"NONE",
"WIDTH_AND_HEIGHT",
"HEIGHT",
"TRUNCATE"
],
"type": "string"
},
"textCase": {
"description": "Text case transformation",
"enum": [
"ORIGINAL",
"UPPER",
"LOWER",
"TITLE",
"SMALL_CAPS",
"SMALL_CAPS_FORCED"
],
"type": "string"
},
"textDecoration": {
"description": "Text decoration type",
"enum": [
"NONE",
"UNDERLINE",
"STRIKETHROUGH"
],
"type": "string"
},
"textTruncation": {
"description": "Text truncation behavior - Plugin API supported",
"enum": [
"DISABLED",
"ENDING"
],
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}