Help guide

For Each Scope node

Updated June 21, 2026

For Each Scope node

Product media placeholder

Replace this area with a screenshot or short walkthrough video during the media sweep.

Per-iteration scope source materialised by `expandInstanceNodes` inside every forEach iteration. Replaces the F351 reserved-token substitution mechanism (`$match`, `$index`) with a port-driven model — template-body nodes wire from this node's outputs the same way they wire from any other producer. Authors do NOT write this node by hand; the loader emits one per iteration with constant per-iteration values.

Type forEachScopeCategory integrationContext sharedDynamic ports yesCompound no

Inputs

PortTypeDescription
--No ports declared.

Outputs

PortTypeDescription
selectorstringPer-iteration matched-element CSS selector. Empty when the parent instance has no `forEach`.
indexfloat0-based iteration index.
countfloatTotal iteration count for this forEach.

Parameters

ParameterTypeDefaultDescription
---No configurable parameters.

Use cases

  • Inside a forEach template, wire `selector` into a writer's selector input port (replaces `"selector": "$match"`).
  • Inside a forEach template, wire `index` into an indexed-aware consumer (e.g. `sectionAlphaGate.myIdx`) (replaces `"myIdx": "$index"`).
  • For embedded selector composition (`"$match .child"`), wire `selector` into a `selectorJoin.prefix` and set `suffix: " .child"`.
  • Custom overridables surface as additional output ports on the scope, carrying the per-iteration resolved value with the same name as the overridable.

Related nodes

Envelope

Use forEachScope as the node type inside a graph node envelope. Add id, optional params, optional connections, and optional activeWhen based on the guide context.

Generated source

Registry faster-motion-docs/node-registry.jsonCategory page /help/faster-motion/faster-motion-node-category-integration/

Was this guide helpful?

Sunny Arora

Written by

Sunny Arora

Get technical deep dives delivered to your inbox

Join creators and developers who get exclusive insights, tutorials, and behind-the-scenes content every week.

No spam. Unsubscribe anytime.

Continue Exploring

You might also enjoy