Shared Node Properties
Nodes support a range of properties. Some properties are universal, some are shared between node types, and some are unique to specific node types.
On this page, you can explore properties which are available on multiple nodes. Properties appear in alphabetical order, and you can see which nodes each property is supported on.
absoluteBoundingBox: Rect | null [readonly]
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
The bounds of the node that does not include rendered properties like drop shadows or strokes. The x
and y
inside this property represent the absolute position of the node on the page.
absoluteRenderBounds: Rect | null [readonly]
Supported on:
The actual bounds of a node accounting for drop shadows, thick strokes, and anything else that may fall outside the node's regular bounding box defined in x
, y
, width
, and height
. The x
and y
inside this property represent the absolute position of the node on the page. This value will be null
if the node is invisible.
absoluteTransform: Transform [readonly]
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
The position of a node relative to its containing page as a Transform
matrix.
addComponentProperty(propertyName: string, type: ComponentPropertyType, defaultValue: string | boolean, options?: ComponentPropertyOptions): string
Supported on:
Adds a new component property to this node and returns the property name with its unique identifier suffixed. This function supports properties with type 'BOOLEAN'
, 'TEXT'
, 'INSTANCE_SWAP'
or 'VARIANT'
.
appendChild(child: SceneNode): void
Supported on:
Adds a new child to the end of the children
array. That is, visually on top of all other children.
attachedConnectors: ConnectorNode[] [readonly]
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- LinkUnfurlNode
- MediaNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
An array of ConnectorNode
s that are attached to a node.
backgroundStyleId: string
[DEPRECATED]
Use fillStyleId
instead.
backgrounds: ReadonlyArray<Paint>
[DEPRECATED]
Use fills
instead.
blendMode: BlendMode
Supported on:
Blend mode of this node, as shown in the Layer panel. In addition to the blend modes that paints & effects support, the layer blend mode can also have the value PASS_THROUGH.
bottomLeftRadius: number
bottomRightRadius: number
children: ReadonlyArray<SceneNode> [readonly]
Supported on:
The list of children, sorted back-to-front. That is, the first child in the array is the bottommost layer on the screen, and the last child in the array is the topmost layer.
View more →clipsContent: boolean
Supported on:
Whether the frame clips its contents. That is, whether layers inside the frame are visible outside the bounds of the frame.
componentPropertyDefinitions: ComponentPropertyDefinitions [readonly]
Supported on:
All component properties and their default values that exist on this component set. 'VARIANT'
properties will also have a list of all variant options. 'BOOLEAN'
, 'TEXT'
, and 'INSTANCE_SWAP'
properties will have their names suffixed by a unique identifier starting with '#'
, which is helpful for quickly distinguishing multiple component properties that have the same name in the Figma UI. The entire property name should be used for all Component property-related API methods and properties.
componentPropertyReferences: { [nodeProperty in 'visible' | 'characters' | 'mainComponent']?: string } | null
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- LinkUnfurlNode
- MediaNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
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).
constrainProportions: boolean
Supported on:
When toggled, causes the layer to keep its proportions when the user resizes it via the properties panel.
constraints: Constraints
Supported on:
Constraints of this node relative to its containing FrameNode
, if any.
cornerRadius: number | figma.mixed
Supported on:
The number of pixels to round the corners of the object by.
View more →cornerSmoothing: number
Supported on:
A value that lets you control how "smooth" the corners are. Ranges from 0 to 1.
View more →counterAxisAlignItems: 'MIN' | 'MAX' | 'CENTER' | 'BASELINE'
Supported on:
Applicable only on auto-layout frames, ignored otherwise. Determines how the auto-layout frame’s children should be aligned in the counter axis direction.
View more →counterAxisSizingMode: 'FIXED' | 'AUTO'
Supported on:
Applicable only on auto-layout frames. Determines whether the counter axis has a fixed length (determined by the user) or an automatic length (determined by the layout engine).
View more →dashPattern: ReadonlyArray<number>
Supported on:
A list of numbers specifying alternating dash and gap lengths, in pixels.
deleteComponentProperty(propertyName: string): void
Supported on:
Deletes an existing component property on this node. This function only supports properties with type 'BOOLEAN'
, 'TEXT'
, or 'INSTANCE_SWAP'
.
description: string
The annotation entered by the user for this style/component.
View more →documentationLinks: ReadonlyArray<DocumentationLink>
The documentation links for this style/component.
View more →editComponentProperty(propertyName: string, newValue: { name?: string, defaultValue?: string | boolean, preferredValues?: InstanceSwapPreferredValue[] }): string
Supported on:
Modifies the name, default value, or preferred values of an existing component property on this node and returns the property name with its unique identifier suffixed.
This function supports properties with type 'BOOLEAN'
, 'TEXT'
, 'INSTANCE_SWAP'
, or 'VARIANT'
with the following restrictions:
name
is supported for all propertiesdefaultValue
is supported for'BOOLEAN'
,'TEXT'
, and'INSTANCE_SWAP'
properties, but not for'VARIANT'
propertiespreferredValues
is only supported for'INSTANCE_SWAP'
properties
effectStyleId: string
Supported on:
The id of the EffectStyle
object that the properties of this node are linked to.
effects: ReadonlyArray<Effect>
Supported on:
Array of effects. See Effect
type. For help on how to change this value, see Editing Properties.
expanded: boolean
Whether this container is shown as expanded in the layers panel.
exportAsync(settings?: ExportSettings): Promise<Uint8Array>
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
exportAsync(settings: ExportSettingsSVGString): Promise<string>
Exports the node as an encoded image.
View more →exportSettings: ReadonlyArray<ExportSettings>
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
List of export settings stored on the node. For help on how to change this value, see Editing Properties.
fillGeometry: VectorPaths
Supported on:
An array of paths representing the object fills relative to the node.
fillStyleId: string | figma.mixed
Supported on:
The id of the PaintStyle
object that the fills
property of this node is linked to.
fills: ReadonlyArray<Paint> | figma.mixed
Supported on:
The paints used to fill the area of the shape. For help on how to change this value, see Editing Properties.
View more →findAll(callback?: (node: SceneNode) => boolean): SceneNode[]
Supported on:
Searches this entire subtree (this node's children, its children's children, etc). Returns all nodes for which callback
returns true.
findAllWithCriteria<T extends NodeType[]>(criteria: { types: T }): Array<{ type: T[number] } & SceneNode>
Supported on:
Searches this entire subtree (this node's children, its children's children, etc). Returns all nodes that satisfy any of the types defined in the criteria.
View more →findChild(callback: (node: SceneNode) => boolean): SceneNode | null
Supported on:
Searches the immediate children of this node (i.e. not including the children's children). Returns the first node for which callback
returns true.
findChildren(callback?: (node: SceneNode) => boolean): SceneNode[]
Supported on:
Searches the immediate children of this node (i.e. not including the children's children). Returns all nodes for which callback
returns true.
findOne(callback: (node: SceneNode) => boolean): SceneNode | null
Supported on:
Searches this entire subtree (this node's children, its children's children, etc). Returns the first node for which callback
returns true.
findWidgetNodesByWidgetId(widgetId: string): Array<WidgetNode>
Supported on:
Searches this entire subtree (this node's children, its children's children, etc). Returns all widget nodes that match the provided widgetId
.
getPluginData(key: string): string
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EffectStyle
- EllipseNode
- EmbedNode
- FrameNode
- GridStyle
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PaintStyle
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- TextStyle
- VectorNode
- WashiTapeNode
- WidgetNode
Retrieves custom information that was stored on this node or style using setPluginData
. If there is no data stored for the provided key, an empty string is returned.
getPluginDataKeys(): string[]
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EffectStyle
- EllipseNode
- EmbedNode
- FrameNode
- GridStyle
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PaintStyle
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- TextStyle
- VectorNode
- WashiTapeNode
- WidgetNode
Retrieves a list of all keys stored on this node or style using using setPluginData
. This enables iterating through all data stored privately on a node or style by your plugin.
getPublishStatusAsync(): Promise<PublishStatus>
Gets the status of this style/component in the team library.
getRelaunchData(): { [command: string]: string }
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
Retreives the reluanch data stored on this node using setRelaunchData
getSharedPluginData(namespace: string, key: string): string
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EffectStyle
- EllipseNode
- EmbedNode
- FrameNode
- GridStyle
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PaintStyle
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- TextStyle
- VectorNode
- WashiTapeNode
- WidgetNode
Retrieves custom information that was stored on this node or style using setSharedPluginData
. If there is no data stored for the provided namespace and key, an empty string is returned.
getSharedPluginDataKeys(namespace: string): string[]
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EffectStyle
- EllipseNode
- EmbedNode
- FrameNode
- GridStyle
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PaintStyle
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- TextStyle
- VectorNode
- WashiTapeNode
- WidgetNode
Retrieves a list of all keys stored on this node or style using setSharedPluginData
. This enables iterating through all data stored in a given namespace.
gridStyleId: string
Supported on:
The id of the GridStyle
object that the layoutGrids
property of this node is linked to.
guides: ReadonlyArray<Guide>
Supported on:
Array of Guide
used inside the frame. Note that each frame has its own guides, separate from the canvas-wide guides. For help on how to change this value, see Editing Properties.
handleMirroring: HandleMirroring | figma.mixed
Supported on:
Whether the vector handles are mirrored or independent.
height: number [readonly]
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
The height of the node. Use a resizing method to change this value.
horizontalPadding: number
Supported on:
[DEPRECATED]
Use paddingLeft
and paddingRight
instead.
id: string [readonly]
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
An internal identifier for a node. Plugins typically don't need to use this since you can usually just access a node directly.
View more →insertChild(index: number, child: SceneNode): void
Supported on:
Adds a new child at the specified index in the children
array.
isMask: boolean
Supported on:
Whether this node is a mask. A mask node masks its subsequent siblings.
itemReverseZIndex: boolean
Supported on:
Applicable only on auto-layout frames. Determines the canvas stacking order of layers in this frame. When true, the first layer will be draw on top.
itemSpacing: number
Supported on:
Applicable only on auto-layout frames. Determines distance between children of the frame.
key: string [readonly]
The key to use with figma.importComponentByKeyAsync
, figma.importComponentSetByKeyAsync
and figma.importStyleByKeyAsync
. Note that while this key is present on local and published components, you can only import components that are already published.
layoutAlign: 'MIN' | 'CENTER' | 'MAX' | 'STRETCH' | 'INHERIT'
Supported on:
Applicable only on direct children of auto-layout frames, ignored otherwise. Determines if the layer should stretch along the parent’s counter axis. Defaults to “INHERIT”
.
layoutGrids: ReadonlyArray<LayoutGrid>
Supported on:
Array of LayoutGrid
objects used as layout grids on this node. For help on how to change this value, see Editing Properties.
layoutGrow: number
Supported on:
This property is applicable only for direct children of auto-layout frames, ignored otherwise. Determines whether a layer should stretch along the parent’s primary axis. 0 corresponds to a fixed size and 1 corresponds to stretch.
View more →layoutMode: 'NONE' | 'HORIZONTAL' | 'VERTICAL'
Supported on:
Determines whether this layer uses auto-layout to position its children. Defaults to "NONE".
View more →layoutPositioning: 'AUTO' | 'ABSOLUTE'
Supported on:
This property is applicable only for direct children of auto-layout frames. Determines whether a layer's size and position should be dermined by auto-layout settings or manually adjustable.
View more →locked: boolean
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- LinkUnfurlNode
- MediaNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
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.
View more →name: string
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
The name of the layer that appears in the layers panel. Calling figma.root.name
will return the name, read-only, of the current file.
numberOfFixedChildren: number
Supported on:
Determines which children of the frame are fixed children in a scrolling frame.
View more →opacity: number
Supported on:
Opacity of the node, as shown in the Layer panel. Must be between 0 and 1.
outlineStroke(): VectorNode | null
Supported on:
This method performs an action similar to using the "Outline Stroke" function in the editor from the right-click menu. However, this method creates and returns a new node while leaving the original intact. Returns null
if the node has no strokes.
overflowDirection: OverflowDirection
Supported on:
Determines whether a frame will scroll in presentation mode when the frame contains content that exceed the frame's bounds. Reflects the value shown in "Overflow Behavior" in the Prototype tab.
View more →overlayBackground: OverlayBackground [readonly]
Supported on:
How this frame obscures the content under it when opened as an overlay.
overlayBackgroundInteraction: OverlayBackgroundInteraction [readonly]
Supported on:
How the user can interact with the content under this frame when opened as an overlay.
overlayPositionType: OverlayPositionType [readonly]
Supported on:
How this frame is positioned when opened as an overlay.
paddingBottom: number
Supported on:
Applicable only on auto-layout frames, ignored otherwise. Determines the bottom padding between the border of the frame and its children.
paddingLeft: number
Supported on:
Applicable only on auto-layout frames, ignored otherwise. Determines the left padding between the border of the frame and its children.
paddingRight: number
Supported on:
Applicable only on auto-layout frames, ignored otherwise. Determines the right padding between the border of the frame and its children.
paddingTop: number
Supported on:
Applicable only on auto-layout frames, ignored otherwise. Determines the top padding between the border of the frame and its children.
parent: (BaseNode & ChildrenMixin) | null [readonly]
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
Returns the parent of this node, if any. This property is not meant to be directly edited. To reparent, see appendChild
.
primaryAxisAlignItems: 'MIN' | 'MAX' | 'CENTER' | 'SPACE_BETWEEN'
Supported on:
Applicable only on auto-layout frames, ignored otherwise. Determines how the auto-layout frame’s children should be aligned in the primary axis direction.
View more →primaryAxisSizingMode: 'FIXED' | 'AUTO'
Supported on:
Applicable only on auto-layout frames. Determines whether the primary axis has a fixed length (determined by the user) or an automatic length (determined by the layout engine).
View more →reactions: ReadonlyArray<Reaction>
Supported on:
List of Reactions on this node, which includes both the method of interaction with this node in a prototype, and the behavior of that interaction. For help on how to change this value, see Editing Properties.
View more →relativeTransform: Transform
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
The position of a node relative to its containing parent as a Transform
matrix. Not used for scaling, see width
and height
instead. Read the details page to understand the nuances of this property.
remote: boolean [readonly]
Whether this style/component is a remote style/component that doesn't live in the file (i.e. is from the team library). Remote components are read-only: attempts to change their properties will throw.
remove(): void
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
Removes this node and all of its children from the document.
View more →removed: boolean [readonly]
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
Returns true if this node has been removed since it was first accessed. If your plugin stays open for a while and stores references to nodes, you should write your code defensively and check that the nodes haven't been removed by the user.
View more →rescale(scale: number): void
Supported on:
Rescales the node. This API function is the equivalent of using the Scale Tool from the toolbar.
View more →resize(width: number, height: number): void
Supported on:
Resizes the node. If the node contains children with constraints, it applies those constraints during resizing. If the parent has auto-layout, causes the parent to be resized.
View more →resizeWithoutConstraints(width: number, height: number): void
Supported on:
Resizes the node. Children of the node are never resized, even if those children have constraints. If the parent has auto-layout, causes the parent to be resized (this constraint cannot be ignored).
View more →rotation: number
Supported on:
The rotation of the node in degrees. Returns values from -180 to 180. Identical to Math.atan2(-m10, m00)
in the relativeTransform
matrix. When setting rotation
, it will also set m00
, m01
, m10
, m11
.
setPluginData(key: string, value: string): void
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EffectStyle
- EllipseNode
- EmbedNode
- FrameNode
- GridStyle
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PaintStyle
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- TextStyle
- VectorNode
- WashiTapeNode
- WidgetNode
Lets you store custom information on any node or style, private to your plugin.
View more →setRelaunchData(data: { [command: string]: string }): void
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
Sets state on the node to show a button and description when the node is selected. Clears the button and description when relaunchData
is {}
.
info
In Figma, this shows up in the properties panel. In FigJam, this shows up in the property menu. See here for examples.
setSharedPluginData(namespace: string, key: string, value: string): void
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EffectStyle
- EllipseNode
- EmbedNode
- FrameNode
- GridStyle
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PaintStyle
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- TextStyle
- VectorNode
- WashiTapeNode
- WidgetNode
Lets you store custom information on any node or style, public to all plugins.
View more →strokeAlign: 'CENTER' | 'INSIDE' | 'OUTSIDE'
Supported on:
The alignment of the stroke with respect to the boundaries of the shape.
View more →strokeBottomWeight: number
Determines the bottom stroke weight on a rectangle node or frame-like node. Must be non-negative and can be fractional.
strokeCap: StrokeCap | figma.mixed
Supported on:
The decoration applied to vertices which have only one connected segment.
View more →strokeGeometry: VectorPaths
Supported on:
An array of paths representing the object strokes relative to the node.
StrokeGeometry is always from the center regardless of the nodes strokeAlign
.
strokeJoin: StrokeJoin | figma.mixed
Supported on:
The decoration applied to vertices which have two or more connected segments.
View more →strokeLeftWeight: number
Determines the left stroke weight on a rectangle node or frame-like node. Must be non-negative and can be fractional.
strokeMiterLimit: number
Supported on:
The miter limit on the stroke. This is the same as the SVG miter limit.
strokeRightWeight: number
Determines the right stroke weight on a rectangle node or frame-like node. Must be non-negative and can be fractional.
strokeStyleId: string
Supported on:
The id of the PaintStyle
object that the strokes
property of this node is linked to.
strokeTopWeight: number
Determines the top stroke weight on a rectangle node or frame-like node. Must be non-negative and can be fractional.
strokeWeight: number | figma.mixed
Supported on:
The thickness of the stroke, in pixels. This value must be non-negative and can be fractional.
caution
For rectangle nodes or frame-like nodes using different individual stroke weights, this property will return figma.mixed
.
info
For rectangle nodes or frame-like nodes, individual stroke weights can be set for each side using the following properties:
strokes: ReadonlyArray<Paint>
Supported on:
The paints used to fill the area of the shape's strokes. For help on how to change this value, see Editing Properties.
strokesIncludedInLayout: boolean
Supported on:
Applicable only on auto-layout frames. Determines whether strokes are included in layout calculations. When true, auto-layout frames behave like css box-sizing: border-box
.
stuckNodes: SceneNode[] [readonly]
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- LinkUnfurlNode
- MediaNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
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.
View more →stuckTo: SceneNode | null
Supported on:
If this node is stuck to another node this property returns that node or null.
View more →toString(): string
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
Returns a string representation of the node. For debugging purposes only, do not rely on the exact output of this string in production code.
View more →topLeftRadius: number
topRightRadius: number
variantProperties: { [property: string]: string } | null [readonly]
Supported on:
[DEPRECATED] This property is deprecated for instance nodes. Use componentProperties
instead.
Variant properties and values for this node. Is null
for nodes that are not variants.
vectorNetwork: VectorNetwork
Supported on:
Exposes a complete, but more complex representation of vectors as a network of edges between vectices. See VectorNetwork
.
vectorPaths: VectorPaths
Supported on:
Exposes a simple, but incomplete representation of vectors as path. See VectorPaths
verticalPadding: number
Supported on:
[DEPRECATED]
Use paddingTop
and paddingBottom
instead.
visible: boolean
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- LinkUnfurlNode
- MediaNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
Whether the node is visible or not. Does not affect a plugin's ability to access the node.
View more →width: number [readonly]
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
The width of the node. Use a resizing method to change this value.
x: number
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
The position of the node. Identical to relativeTransform[0][2]
.
y: number
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
The position of the node. Identical to relativeTransform[1][2]
.