Skip to main content

Figma files

Every file in Figma consists of a tree of nodes. At the root of every file is a DOCUMENT node, and from that node stems any CANVAS nodes. Every canvas node represents a PAGE in a Figma file. A canvas node can then have any number of nodes as its children. Each subtree stemming from a canvas node will represent a layer (e.g an object) on the canvas.

Nodes have a number of properties associated with them. Some of these are global properties, that exist on every node, whereas other node properties will be specific to the type of node.

Global properties

The following are properties that exist on every node. These give us some basic information about identifying and viewing the node.

Node typeProperties

Node

idString
A string uniquely identifying this node within the document.
nameString
The name given to the node by the user in the tool.
visibleBooleandefault: true
Whether or not the node is visible on the canvas.
typeString
The type of the node; refer to table below for details.
rotationNumber
The rotation of the node, if not 0.
pluginDataAny
Data written by plugins that is visible only to the plugin that wrote it. Requires the pluginData to include the ID of the plugin.
sharedPluginDataAny
Data written by plugins that is visible to all plugins. Requires the pluginData parameter to include the string "shared".
componentPropertyReferencesMap<String, String>
A mapping of a layer's property to component property name of component properties attached to this node. The component property name can be used to look up more information on the corresponding component's or component set's componentPropertyDefinitions.
boundVariablesMap<String, VariableAlias | VariableAlias[] | Map<String, VariableAlias>>

A mapping of field to the variables applied to this field. Most fields will only map to a single VariableAlias. However, for fills, strokes, size, and component properties, it is possible to have multiple variables bound to the field.

explicitVariableModesMap<String, String>
A mapping of variable collection ID to mode ID representing the explicitly set modes for this node.