SceneNodeMixin
Defined in: figmaPluginTypes.ts:5145
https://www.figma.com/plugin-docs/api/node-properties
readonlyattachedConnectors:ConnectorNode[]
Defined in: figmaPluginTypes.ts:5183
An array of ConnectorNodes that are attached to a node.
readonlyoptionalboundVariables:object&object&object
Defined in: figmaPluginTypes.ts:5195
The variables bound to a particular field on this node. Please see the Working with Variables guide for how to get and set variable bindings.
optionalbottomLeftRadius:VariableAlias
optionalbottomRightRadius:VariableAlias
optionalcharacters:VariableAlias
optionalcounterAxisSpacing:VariableAlias
optionalheight:VariableAlias
optionalitemSpacing:VariableAlias
optionalmaxHeight:VariableAlias
optionalmaxWidth:VariableAlias
optionalminHeight:VariableAlias
optionalminWidth:VariableAlias
optionalopacity:VariableAlias
optionalpaddingBottom:VariableAlias
optionalpaddingLeft:VariableAlias
optionalpaddingRight:VariableAlias
optionalpaddingTop:VariableAlias
optionalstrokeBottomWeight:VariableAlias
optionalstrokeLeftWeight:VariableAlias
optionalstrokeRightWeight:VariableAlias
optionalstrokeTopWeight:VariableAlias
optionalstrokeWeight:VariableAlias
optionaltopLeftRadius:VariableAlias
optionaltopRightRadius:VariableAlias
optionalvisible:VariableAlias
optionalwidth:VariableAlias
optionalfontFamily:VariableAlias[]
optionalfontSize:VariableAlias[]
optionalfontStyle:VariableAlias[]
optionalfontWeight:VariableAlias[]
optionalletterSpacing:VariableAlias[]
optionallineHeight:VariableAlias[]
optionalparagraphIndent:VariableAlias[]
optionalparagraphSpacing:VariableAlias[]
readonlyoptionalcomponentProperties:object
[propertyName: string]: VariableAlias
readonlyoptionaleffects:VariableAlias[]
readonlyoptionalfills:VariableAlias[]
readonlyoptionallayoutGrids:VariableAlias[]
readonlyoptionalstrokes:VariableAlias[]
readonlyoptionaltextRangeFills:VariableAlias[]
componentPropertyReferences:
null| {characters?:string;mainComponent?:string;visible?:string; }
Defined in: figmaPluginTypes.ts:5187
All component properties that are attached on this node. A node can only have componentPropertyReferences if it is a component sublayer or an instance sublayer. It will be null otherwise. The value in the key-value pair refers to the component property name as returned by componentPropertyDefinitions on the containing component, component set or main component (for instances).
explicitVariableModes:
object
Defined in: figmaPluginTypes.ts:8250
The explicitly set modes for this node.
For SceneNodes, represents a subset of SceneNodeMixin.resolvedVariableModes.
Note that this does not include workspace and team-default modes.
[collectionId: string]: string
ExplicitVariableModesMixin.explicitVariableModes
readonlyoptionalinferredVariables:object&object
Defined in: figmaPluginTypes.ts:5248
An object, keyed by field, returning any variables that match the raw value of that field for the mode of the node (or the default variable value if no mode is set)
optionalbottomLeftRadius:VariableAlias[]
optionalbottomRightRadius:VariableAlias[]
optionalcharacters:VariableAlias[]
optionalcounterAxisSpacing:VariableAlias[]
optionalheight:VariableAlias[]
optionalitemSpacing:VariableAlias[]
optionalmaxHeight:VariableAlias[]
optionalmaxWidth:VariableAlias[]
optionalminHeight:VariableAlias[]
optionalminWidth:VariableAlias[]
optionalopacity:VariableAlias[]
optionalpaddingBottom:VariableAlias[]
optionalpaddingLeft:VariableAlias[]
optionalpaddingRight:VariableAlias[]
optionalpaddingTop:VariableAlias[]
optionalstrokeBottomWeight:VariableAlias[]
optionalstrokeLeftWeight:VariableAlias[]
optionalstrokeRightWeight:VariableAlias[]
optionalstrokeTopWeight:VariableAlias[]
optionalstrokeWeight:VariableAlias[]
optionaltopLeftRadius:VariableAlias[]
optionaltopRightRadius:VariableAlias[]
optionalvisible:VariableAlias[]
optionalwidth:VariableAlias[]
readonlyoptionalfills:VariableAlias[][]
readonlyoptionalstrokes:VariableAlias[][]
Inferred variables are only returned for a field when it is not using a bound variable.
Variables can be inferred from:
- The collections of variables used in the file
- Variables from subscribed libraries, provided the variable is used in the file
Variables can only be inferred when there is a single variable that matches the raw value used for the scope of the variable.
- i.e. For a property set to width: 100px, where there are two variables set to a value of 100 with the default scope, a value cannot be inferred as there are two matches.
- i.e. For a property set to width: 100px, where there is a variable set to 100 with a scope of "Width and height" and a variable set to 100 with a scope of "Corner radius", a value can be inferred as there is a single match for the given scope.
Inferred variables for fills and strokes return a list of results where the index matches that of node.fills and node.strokes.
- i.e. node.inferredVariables.fills[0] holds the inferred variables for node.fills[0]
locked:
boolean
Defined in: figmaPluginTypes.ts:5167
Whether the node is locked or not, preventing certain user interactions on the canvas such as selecting and dragging. Does not affect a plugin's ability to write to those properties.
The value that this property returns is independent from the node's parent. i.e.
- The node isn't necessarily locked if this is
.locked === true. - The node isn't necessarily unlocked if this is
.locked === false. - An object is locked if
.locked == truefor itself or any of its parents.
resolvedVariableModes:
object
Defined in: figmaPluginTypes.ts:5292
The resolved mode for this node for each variable collection in this file.
[collectionId: string]: string
The set of resolved modes on a node includes the explicitly set modes on the node, as well as the explicitly set modes on ancestors of the node. By default, nodes automatically inherit the modes of their parents.
// Create two collections with two modes each
const collection1 = figma.variables.createVariableCollection("Collection 1");
const collection1Mode1Id = collection1.modes[0].modeId;
const collection1Mode2Id = collection1.addMode("Mode 2");
const collection2 = figma.variables.createVariableCollection("Collection 2");
const collection2Mode1Id = collection2.modes[0].modeId;
const collection2Mode2Id = collection2.addMode("Mode 2");
const parentFrame = figma.createFrame();
const childFrame = figma.createFrame();
parentFrame.appendChild(childFrame);
parentFrame.setExplicitVariableModeForCollection(
collection1,
collection1Mode2Id
);
childFrame.setExplicitVariableModeForCollection(
collection2,
collection2Mode1Id
);
// Example output (only collection2 is present):
// { 'VariableCollectionId:1:3': '1:2' }
console.log(childFrame.explicitVariableModes);
// Example output (both collections are present):
// { 'VariableCollectionId:1:2': '1:1', 'VariableCollectionId:1:3': '1:2' }
console.log(childFrame.resolvedVariableModes);
readonlystuckNodes:SceneNode[]
Defined in: figmaPluginTypes.ts:5179
An array of nodes that are "stuck" to this node. In FigJam, stamps, highlights, and some widgets can "stick" to other nodes if they are dragged on top of another node.
This property is only available in FigJam.
In FigJam a stickable host that means that stickables, like 'STAMP' nodes, are allowed to attach themselves to the node. If the stickable host moves all nodes that are in stuckNodes move along with it.
visible:
boolean
Defined in: figmaPluginTypes.ts:5156
Whether the node is visible or not. Does not affect a plugin's ability to access the node.
The value that this property returns is independent from the node's parent. i.e.
- The node isn't necessarily visible if this is
.visible === true. - The node isn't necessarily invisible if this is
.visible === false. - An object is visible if
.visible == truefor itself and all its parents.
clearExplicitVariableModeForCollection(
collectionId):void
Defined in: figmaPluginTypes.ts:8258
Clears an explicit mode for the given collection on this node
string
void
Use clearExplicitVariableModeForCollection(VariableCollection) instead. This function will throw an exception if the plugin manifest contains "documentAccess": "dynamic-page".
ExplicitVariableModesMixin.clearExplicitVariableModeForCollection
clearExplicitVariableModeForCollection(
collection):void
Defined in: figmaPluginTypes.ts:8264
Clears an explicit mode for the given collection on this node
A variable collection. Make sure to pass a collection object here; passing a variable collection ID is deprecated.
void
ExplicitVariableModesMixin.clearExplicitVariableModeForCollection
setBoundVariable(
field,variableId):void
Defined in: figmaPluginTypes.ts:5214
Binds the provided field on this node to the given variable. Please see the Working with Variables guide for how to get and set variable bindings.
VariableBindableTextField | VariableBindableNodeField
null | string
void
Use setBoundVariable(VariableBindableNodeField, Variable) instead. This function will throw an exception if the plugin manifest contains "documentAccess": "dynamic-page".
setBoundVariable(
field,variable):void
Defined in: figmaPluginTypes.ts:5226
Binds the provided field on this node to the given variable. Please see the Working with Variables guide for how to get and set variable bindings.
If null is provided as the variable, the given field will be unbound from any variables.
The field to bind the variable to.
VariableBindableTextField | VariableBindableNodeField
The variable to bind to the field. If null is provided, the field will be unbound from any variables. Make sure to pass a Variable object or null; passing a variable ID is deprecated.
null | Variable
void
setExplicitVariableModeForCollection(
collectionId,modeId):void
Defined in: figmaPluginTypes.ts:8270
Sets an explicit mode for the given collection on this node
string
string
void
Use setExplicitVariableModeForCollection(VariableCollection, Variable) instead. This function will throw an exception if the plugin manifest contains "documentAccess": "dynamic-page".
ExplicitVariableModesMixin.setExplicitVariableModeForCollection
setExplicitVariableModeForCollection(
collection,modeId):void
Defined in: figmaPluginTypes.ts:8277
Sets an explicit mode for the given collection on this node
A variable collection. Make sure to pass a collection object here; passing a variable collection ID is deprecated.
string
A variable mode ID.
void
ExplicitVariableModesMixin.setExplicitVariableModeForCollection