create_button
Generate customizable buttons in Figma with specified coordinates, size, text, colors, font, corner radius, and parent node. Ideal for batch creation and precise design control.
Instructions
Creates a complete button with background and text in Figma at the specified coordinates. You can customize size, text, colors, font, corner radius, name, and parent node.
Returns:
content: Array of objects. Each object contains a type: "text" and a text field with the created button's frame, background, and text node IDs.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
background | No | The background color of the button as RGBA. | |
buttons | No | An array of button creation entries for batch creation. | |
cornerRadius | No | The corner radius for the button. | |
fontSize | No | The font size for the button text. | |
fontWeight | No | The font weight for the button text. | |
height | No | The height of the button in pixels. | |
name | No | The name to assign to the button node. | |
parentId | No | The parent node ID to attach the button to. | |
text | No | The text label for the button. | |
textColor | No | The text color of the button as RGBA. | |
width | No | The width of the button in pixels. | |
x | No | The X coordinate for the button on the Figma canvas. | |
y | No | The Y coordinate for the button on the Figma canvas. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"background": {
"additionalProperties": false,
"description": "The background color of the button as RGBA.",
"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"
},
"buttons": {
"description": "An array of button creation entries for batch creation.",
"items": {
"additionalProperties": false,
"description": "A single button creation entry.",
"properties": {
"background": {
"additionalProperties": false,
"description": "The background color of the button as RGBA.",
"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"
},
"cornerRadius": {
"description": "The corner radius for the button.",
"maximum": 100,
"minimum": 0,
"type": "number"
},
"fontSize": {
"description": "The font size for the button text.",
"maximum": 200,
"minimum": 1,
"type": "number"
},
"fontWeight": {
"description": "The font weight for the button text.",
"maximum": 1000,
"minimum": 100,
"type": "number"
},
"height": {
"description": "The height of the button in pixels.",
"maximum": 2000,
"minimum": 1,
"type": "number"
},
"name": {
"description": "The name to assign to the button node.",
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"parentId": {
"description": "The parent node ID to attach the button to.",
"type": "string"
},
"text": {
"description": "The text label for the button.",
"maxLength": 200,
"minLength": 1,
"type": "string"
},
"textColor": {
"additionalProperties": false,
"description": "The text color of the button as RGBA.",
"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"
},
"width": {
"description": "The width of the button in pixels.",
"maximum": 2000,
"minimum": 1,
"type": "number"
},
"x": {
"description": "The X coordinate for the button on the Figma canvas.",
"maximum": 10000,
"minimum": -10000,
"type": "number"
},
"y": {
"description": "The Y coordinate for the button on the Figma canvas.",
"maximum": 10000,
"minimum": -10000,
"type": "number"
}
},
"required": [
"x",
"y"
],
"type": "object"
},
"type": "array"
},
"cornerRadius": {
"description": "The corner radius for the button.",
"maximum": 100,
"minimum": 0,
"type": "number"
},
"fontSize": {
"description": "The font size for the button text.",
"maximum": 200,
"minimum": 1,
"type": "number"
},
"fontWeight": {
"description": "The font weight for the button text.",
"maximum": 1000,
"minimum": 100,
"type": "number"
},
"height": {
"description": "The height of the button in pixels.",
"maximum": 2000,
"minimum": 1,
"type": "number"
},
"name": {
"description": "The name to assign to the button node.",
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"parentId": {
"description": "The parent node ID to attach the button to.",
"type": "string"
},
"text": {
"description": "The text label for the button.",
"maxLength": 200,
"minLength": 1,
"type": "string"
},
"textColor": {
"additionalProperties": false,
"description": "The text color of the button as RGBA.",
"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"
},
"width": {
"description": "The width of the button in pixels.",
"maximum": 2000,
"minimum": 1,
"type": "number"
},
"x": {
"description": "The X coordinate for the button on the Figma canvas.",
"maximum": 10000,
"minimum": -10000,
"type": "number"
},
"y": {
"description": "The Y coordinate for the button on the Figma canvas.",
"maximum": 10000,
"minimum": -10000,
"type": "number"
}
},
"type": "object"
}