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.
Extended collections allow you to create variants of existing variable collections with custom override values. When you extend a collection, the new extended collection inherits all variables and modes from its parent collection, but can specify different values for any inherited variables. This is useful for creating themed variants, regional customizations, or brand variations while maintaining a single source of truth.
Key characteristics of extended collections:
- Inheritance: Extended collections automatically include all variables from their parent collection.
- Overrides: You can override any inherited variable's value for any mode in the extended collection.
- Extended Mode IDs: Extended collections use an encoded mode ID format that includes both the collection ID and the mode ID (e.g.,
VariableCollectionId:1:2/3:4). This format distinguishes between updating values in the root collection vs. overriding values in an extended collection. - Local Only: At this time, only local variable collections can be extended via the REST API. However, you can still modify local extensions of subscribed collections.
Terminology note: A parent collection refers to the collection being directly extended. A root collection refers to the original collection where a variable was created, which may be different if the collection chain is longer than two.
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. |
|