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.

If the manifest contains "documentAccess": "dynamic-page", and the node is a PageNode, you must first call loadAsync to access this function.

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 firstChildFrame = figma.currentPage.findChild(n => n.type === "FRAME")