Searches this entire page (this node's children, its children's children, etc.). Returns the first node for which
callback returns true.
findOne(callback: (node: PageNode | SceneNode) => boolean): PageNode | SceneNode | null
A function that evaluates whether to return the provided
This function returns
null if no matching node is found. The traversal order is the same as in
Note that the root node itself is not included.
Example: find one node whose name is "Template":
const template = figma.root.findOne(n => n.name === "Template")
⚠ Large documents in Figma can have tens of thousands of nodes. Be careful using this function as it could be very slow. Please refer to our recommendations for how to optimize document traversals.