findChildren
Searches the immediate children of this node (i.e. all page nodes, not including their children). Returns all pages for which callback
returns true.
Supported On:
Signature
findChildren(callback?: (node: PageNode) => boolean): Array<PageNode>
Parameters
callback
A function that evaluates whether to return the provided node
. If this argument is omitted, findChildren
returns node.children
.
Remarks
Example: find all empty pages.
const colors = figma.currentPage.findChildren(n => n.children.length === 0)