set_text
Add text elements to Figma with precise positioning, styling, and optional bounded text boxes. Supports single or batch creation for efficient design workflows.
Instructions
Creates one or more text elements in Figma. Accepts either a single text config (via 'text') or an array of configs (via 'texts'). If 'width' and 'height' are provided, creates a bounded text box; otherwise, creates a regular text node.
Returns:
content: Array of objects. Each object contains a type: "text" and a text field with the created text node ID(s).
Input Schema
Name | Required | Description | Default |
---|---|---|---|
text | No | A single text element configuration. Optional. | |
texts | No | An array of text element configurations for batch creation. Optional. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"text": {
"additionalProperties": false,
"description": "A single text element configuration. Optional.",
"properties": {
"fontColor": {
"description": "Optional. Font color."
},
"fontSize": {
"description": "Optional. Font size. Must be between 1 and 200.",
"maximum": 200,
"minimum": 1,
"type": "number"
},
"fontWeight": {
"description": "Optional. Font weight. Must be between 100 and 1000.",
"maximum": 1000,
"minimum": 100,
"type": "number"
},
"height": {
"description": "Optional. Height of the text box. If provided, creates a bounded text box. Must be between 1 and 2000.",
"maximum": 2000,
"minimum": 1,
"type": "number"
},
"name": {
"description": "Optional. Name for the text node. If provided, must be a non-empty string up to 100 characters.",
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"parentId": {
"description": "Optional. Figma node ID of the parent. If provided, must be a string in the format '123:456'.",
"pattern": "^\\d+:\\d+$",
"type": "string"
},
"text": {
"description": "The text content. Must be a non-empty string up to 10,000 characters.",
"maxLength": 10000,
"minLength": 1,
"type": "string"
},
"width": {
"description": "Optional. Width of the text box. If provided, creates a bounded text box. Must be between 1 and 2000.",
"maximum": 2000,
"minimum": 1,
"type": "number"
},
"x": {
"description": "X coordinate for the text element. Must be between -10,000 and 10,000.",
"maximum": 10000,
"minimum": -10000,
"type": "number"
},
"y": {
"description": "Y coordinate for the text element. Must be between -10,000 and 10,000.",
"maximum": 10000,
"minimum": -10000,
"type": "number"
}
},
"required": [
"x",
"y",
"text"
],
"type": "object"
},
"texts": {
"description": "An array of text element configurations for batch creation. Optional.",
"items": {
"$ref": "#/properties/text"
},
"type": "array"
}
},
"type": "object"
}