itemReverseZIndex
Applicable only on "HORIZONTAL" or "VERTICAL" auto-layout frames. Determines the canvas stacking order of layers in this frame. When true, the first layer will be draw on top.
Signature
itemReverseZIndex: boolean
Remarks
Auto-layout frame with different canvas stacking
const parentFrame = figma.createFrame()
// Create red and green children so we can see the overlap
const child1 = figma.createFrame()
child1.fills = [{ type: 'SOLID', color: { r: 1, g: 0, b: 0 }}]
const child2 = figma.createFrame()
child2.fills = [{ type: 'SOLID', color: { r: 0, g: 1, b: 0 }}]
parentFrame.appendChild(child1)
parentFrame.appendChild(child2)
parentFrame.layoutMode = 'HORIZONTAL'
// Negative horizontal gap between children so they overlap
parentFrame.itemSpacing = -20
// Parent frame (last child on top)
// +---------------------+
// |+-------+-----------+|
// || | ||
// ||Child 1| Child 2 ||
// || | ||
// |+-------+-----------+|
// +---------------------+
parentFrame.itemReverseZIndex = false
// Parent frame (first child on top)
// +---------------------+
// |+-----------+-------+|
// || | ||
// || Child 1 |Child 2||
// || | ||
// |+-----------+-------+|
// +---------------------+
parentFrame.itemReverseZIndex = true