create_variable
Create a variable in a Figma collection by specifying its name, collection, and data type (boolean, float, string, or color). The variable starts empty, ready for per-mode values and binding to nodes or paints.
Instructions
Create a variable in a collection with resolvedType BOOLEAN / FLOAT / STRING / COLOR. The variable starts empty — set per-mode values with set_variable_value, then attach it with bind_variable_to_node or bind_variable_to_paint. Returns { ok, variableId, name }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Variable name, e.g. "color/primary" | |
| collectionId | Yes | Variable collection id | |
| resolvedType | Yes | Variable data type |