Skip to main content

findChild

Searches the immediate children of this node (i.e. all page nodes, not including their children). Returns the first page for which callback returns true.

Supported on:

Signature​

findChild(callback: (node: PageNode) => boolean): PageNode | 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 page matching a certain name scheme

const firstTemplate = figma.root.findChild(n => n.name.includes("template"))