Skip to main content

key and bind-key

Name a stable logical instance across updates.

Quick reference​

SyntaxBehavior
key="details"Literal key on a fixed node.
bind-key="data.id"Evaluated key on a fixed node.
For key="item.id"Expression in item scope.

Example​

<Column>
<For each="item" in="data.rows" key="item.id">
<Text bind-text="item.title" />
</For>
</Column>

Supply this object as the document’s data:

{"rows":[{"id":"one","title":"First item"},{"id":"two","title":"Second item"}]}

Rules and validation​

Keys are unique strings or numbers. Duplicate keys fail. Repetition keys evaluate before child state initializes and cannot read that state. Changing a key starts a fresh instance. A revision/ETag is not a UI reset key. Keys do not connect unrelated navigation destinations.

Collections · Layout movement