Types
Variables in Figma have preset types (string, boolean, float, etc…), belong to a variable collection, and hold a different value for each mode in the collection. Certain node properties can bind to variables, enabling these properties to change dynamically when variables are updated or when the node is associated with a different mode.
The below types are returned by the GET local variables and GET published variables endpoints, with the published variables endpoint returning a subset of these properties. Please refer to the return values for each endpoint for more details.
Name | Properties |
---|---|
VariableCollectionA grouping of related Variable objects each with the same modes. |
|
VariableA Variable is a single design token that defines values for each of the modes in its VariableCollection. These values can be applied to various kinds of design properties. |
|
VariableAliasAn object that serves as an alias for a variable. All properties are required. |
|
VariableScopeScopes allow a variable to be shown/hidden in the variable picker UI for various fields. This declutters the Figma UI if you have a large number of variables. Currently only supported on
Likewise, | Valid scopes for
Valid scopes for
Valid scopes for
|
VariableCodeSyntaxAn object containing platform-specific code syntax definitions for a variable. All platforms are optional. |
|