[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/flow](../../README) / [index](../README) / For

# Function: For()

> **For**\<`T`\>(`props`): [`HtmlNode`](../type-aliases/HtmlNode)

Defined in: [flow/src/components.ts:834](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/components.ts#L834)

Reactive list. The AOT compiler turns `<For each={this.items} keyBy="id">{(item) => …}</For>`
into an Alpine `<template x-for>`, so `appendOptimistic`/`removeOptimistic` (and any client change
to the array) re-render it instantly while server patches stay authoritative. This runtime body is
a static fallback, used only when a page's render couldn't be ahead-of-time compiled.

## Type Parameters

### T

`T`

## Parameters

### props

[`ForProps`](../interfaces/ForProps)\<`T`\>

## Returns

[`HtmlNode`](../type-aliases/HtmlNode)

## Example

```tsx
<For each={this.items} keyBy="id">
  {(item) => <li>{item.name}</li>}
</For>
```
