Skip to main content

findChild

Searches the immediate children of this node (i.e. not including the children's children). Returns the first node for which callback returns true.

Signature

findChild(callback: (node: SceneNode) => boolean): SceneNode | null

Parameters

callback

A function that evaluates whether to return the provided node.

Remarks

This function returns null if no matching node is found.

Example: find the first frame that is an immediate child of the current page.

const colors = figma.currentPage.findChild(n => n.type === "FRAME")