Render a collection
Render three rows from an array and give each one stable identity.
Before you start: Show conditional content.
For repeats its children. each="item" names the immutable item variable; in="rows" evaluates the collection. key="item.id" identifies an item across updates. Keys must be unique strings or numbers.
Repeat three rows
The key is the stable ID, not the item’s current position. item.title reads the current row.
<Column state="{rows:[{id:'a',title:'Sketch'},{id:'b',title:'Build'},{id:'c',title:'Ship'}]}" class="p-4 gap-3">
<For each="item" in="rows" key="item.id">
<Text bind-text="item.title" class="p-2 bg-card" />
</For>
</Column>
Render a collection
editable
rReady to explore
Try it: Add a fourth record with a new ID. Change a title without changing its ID.
Next: reuse a component. For large data sets, use List with a bounded viewport.