Frame
A rectangular container with its own fill, stroke and rounded corners. It clips its children to its box unless clipContent is off, and can arrange them in a row or a column with auto layout.
In a formula, a node is called by its name in the layers panel: Frame1.corner
Properties
cornerNumber | [Number × 5]#
Rounds the corners, in pixels: one number for all four, or five numbers to round them one by one.
Five numbers are [all, top-left, top-right, bottom-right, bottom-left]. Writing one number makes every corner equal again. Reading gives the five numbers.
Default 0 · 0 – 4096 · pixels · animatable
layoutModeString#
How the frame places its children: NONE leaves each child where its own x and y put it, HORIZONTAL lines them up in a row, VERTICAL in a column.
HORIZONTAL and VERTICAL turn on auto layout, which adds the gap, padding and alignment properties.
Default 'NONE' · animatable
clipContentBoolean#
When true, children are cut off at the edge of the frame; when false, they draw outside it.
Default true · animatable
layoutDirectionString#
The axis children are lined up along: HORIZONTAL is a row, VERTICAL a column.
layoutMode sets this when you choose HORIZONTAL or VERTICAL.
Default 'HORIZONTAL' · animatable
layoutGapNumber#
Minimum space between neighbouring children along the layout direction, in pixels.
Written as 12, 12px or a percentage such as 10%, which is a share of the frame's content length along the layout direction (its size minus padding). With a spread value of layoutJustify, the gap is the least space; leftover room is added to it.
Default 0 · 0 – ∞ · animatable
layoutJustifyString#
Where children sit along the layout direction: START, CENTER or END of the frame, or spread out with SPACE_BETWEEN, SPACE_AROUND or SPACE_EVENLY.
SPACE_BETWEEN puts the first and last child at the edges and shares the leftover room between children. SPACE_AROUND gives each child equal room on both sides, so the edges get half a share. SPACE_EVENLY makes every gap equal, edges included. The spread values do nothing when a child fills the layout direction or when the children already take all the room; a single child under SPACE_BETWEEN stays at the start.
Default 'START' · animatable
layoutAlignString#
Where children sit across the layout direction: START, CENTER or END of the content area, or STRETCH to fill it.
NONE leaves the cross position to each child's own pin. A child that sets its own cross-axis pin or sizing overrides this value.
Default 'NONE' · animatable
paddingTopNumber#
Space between the top edge of the frame and its children, in pixels.
Written as 12, 12px or a percentage such as 10%, which is a share of the frame's height. Opposite sides that add up to more than the frame are scaled down together to fit.
Default 0 · 0 – ∞ · animatable
paddingRightNumber#
Space between the right edge of the frame and its children, in pixels.
Written as 12, 12px or a percentage such as 10%, which is a share of the frame's width. Opposite sides that add up to more than the frame are scaled down together to fit.
Default 0 · 0 – ∞ · animatable
paddingBottomNumber#
Space between the bottom edge of the frame and its children, in pixels.
Written as 12, 12px or a percentage such as 10%, which is a share of the frame's height. Opposite sides that add up to more than the frame are scaled down together to fit.
Default 0 · 0 – ∞ · animatable
paddingLeftNumber#
Space between the left edge of the frame and its children, in pixels.
Written as 12, 12px or a percentage such as 10%, which is a share of the frame's width. Opposite sides that add up to more than the frame are scaled down together to fit.
Default 0 · 0 – ∞ · animatable
activeClipString#
Name of the timeline clip this frame plays; its children follow that clip.
Keyable: a keyframe switches the frame to another clip from that frame on. A frame with only the default clip, main, has no choice to make.
Default 'main' · animatable
Transform from Transform
xNumber#
Horizontal position of the node's origin, in pixels from its parent's origin.
The origin is the point the node turns and scales around (the small circle you can drag on the canvas). Setting x moves the whole node so that its origin lands there.
pixels · animatable
yNumber#
Vertical position of the node's origin, in pixels from its parent's origin. Larger values are lower.
pixels · animatable
wNumber#
Width of the node in pixels.
On a skewed node this is the width you see on screen, not the width of the box before the skew.
0 – ∞ · pixels · animatable
rotationNumber#
How far the node is turned around its origin, in degrees. Positive values turn it clockwise.
degrees · animatable
skewNumber#
How far the node is slanted along its own horizontal axis, in degrees.
Accepted values are -89 to 89, and 0 means no slant. The node stays anchored at its origin. A skewed node reports a wider w, because w is the width you see on screen. Bones and skeletons ignore skew.
degrees
Fill from Fill
fillsPaint[]#
The list of paints that fill the inside of the shape.
Paints are drawn in list order, so each one covers the one before it. A new shape starts with one grey solid paint. An empty list leaves the shape unfilled. Read a single paint with fills[0].
animatable
Stroke from Stroke
strokesPaint[]#
The list of paints that colour the outline.
A new shape has no strokes, so no outline is drawn until you add one. Paints are drawn in list order.
animatable
strokeWeightStrokeWeight#
Thickness of the outline in pixels.
The default is 1. A weight of 0 draws no outline.
0 – ∞ · animatable
strokePositionString#
Where the outline sits relative to the edge of the shape: INSIDE, CENTER or OUTSIDE.
CENTER puts half of the weight on each side of the edge. INSIDE and OUTSIDE put all of it on one side.
Default 'CENTER' · 'INSIDE' | 'CENTER' | 'OUTSIDE' · animatable
strokeJoinString#
How the outline turns at a sharp corner: MITER (pointed), ROUND or BEVEL (cut flat).
A MITER corner sharper than strokeMiterAngle is cut flat like a BEVEL.
Default 'MITER' · 'MITER' | 'ROUND' | 'BEVEL' · animatable
strokeMiterAngleNumber#
The sharpest corner angle, in degrees, that still gets a pointed MITER join.
Corners sharper than this are cut flat. A larger value cuts more corners. The default is 26 and the lowest accepted value is 8. It has no effect when strokeJoin is ROUND or BEVEL.
Default 26 · 8 – 180 · animatable
dashCapString#
Shape of the ends of each dash in a dashed outline: butt (flat), round or square.
This is separate from strokeCap, which shapes the two ends of the whole path. It only shows when the outline is dashed.
Default 'butt' · 'butt' | 'round' | 'square' · animatable
Appearance from Appearance
opacityNumber#
How opaque the node is, from 0 (invisible) to 1 (solid).
It applies to the node and everything inside it. It multiplies with the opacity of each paint.
Default 1 · 0 – 1 · animatable
blendModeBlendMode#
How the node mixes its colours with what is behind it, for example MULTIPLY or SCREEN.
NORMAL just draws over the background. The other values are NORMAL, PASS_THROUGH, MULTIPLY, SCREEN, OVERLAY, DARKEN, LIGHTEN, COLOR_DODGE, COLOR_BURN, HARD_LIGHT, SOFT_LIGHT, DIFFERENCE, EXCLUSION, HUE, SATURATION, COLOR and LUMINOSITY.
Default 'NORMAL' · animatable
visibleBoolean#
Whether the node is drawn. Set it to false to hide the node and everything inside it.
A hidden node still exists, so formulas can read and change its properties.
Default true · animatable
Node methods every node has them
is(typeOrTag: String) → Booleanmethod#
True when the node is of this type or carries this tag.
typeOrTagA node type such as 'RECT', or a tag.
clone() → Nodemethod#
Makes a copy of the node and returns it, so code can place and change the copy.
destroy()method#
Marks the node for removal; it is taken out of the scene at the end of the frame.
appendChild(child: Node) → Nodemethod#
Moves child into this node as its last child and returns it.
insertBefore(newChild: Node, refChild: Node | null) → Nodemethod#
Moves newChild into this node, just before refChild, and returns it.
refChildThe child to insert before; null appends at the end.
removeChild(child: Node) → Nodemethod#
Takes child out of this node and returns it.
replaceChildren(...nodes: Node)method#
Replaces all of this node's children with the given nodes, in that order.
insertAdjacentElement(position: 'afterbegin' | 'beforeend', element: Node) → Node | nullmethod#
Moves element into this node, as its first or last child.
position'afterbegin' puts it first, 'beforeend' last. Any other position does nothing and returns null.
on(event: String, fn: Function)method#
Calls fn each time fire(event) is called on this node. These are the node's own messages, not the Events panel: a click does not reach on('click').
off(event: String, fn: Function)method#
Stops calling fn for event.
fnThe same function that was passed to on.
fire(event: String, ...args: any)method#
Calls every function added with on(event) on this node, in the order they were added.
...argsPassed on to every listener.