Skip to main content

For, Item, and Empty

Repeat small collections or render windowed List items.

Quick reference​

SyntaxBehavior
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.
EmptyOptional 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.

Collection lesson · List