For, Item, and Empty
Repeat small collections or render windowed List items.
Quick reference
| Syntax | Behavior |
|---|---|
For each="item" in="data.rows" key="item.id" | Structural repetition, with immutable item scope. |
Item name="item" key="item.id" | One item template inside List. |
Empty | Optional empty-state template following Item. |
Example
<List bind-items="data.rows" class="h-60">
<Item name="item" key="item.id"><Text bind-text="item.title" /></Item>
<Empty><Text text="No rows" /></Empty>
</List>
Supply this object as the document’s data:
{"rows":[{"id":"one","title":"First item"},{"id":"two","title":"Second item"}]}
Rules and validation
For accepts one or more child templates. Item and Empty each require one rendered root; List has one Item then at most one Empty. Structural elements do not accept ordinary state/class/handlers. Item names cannot shadow visible state or reserved roots. Give windowed lists a bounded viewport.