Repeat

Render reactive lists with keyed repeat templates.

Repeat aka List

PHP
<?php $items = state([ ['id' => 1, 'name' => 'First item'], ['id' => 2, 'name' => 'Second item'], ['id' => 3, 'name' => 'Third item'], ['id' => 4, 'name' => 'Fourth item'], ]); $item = el('li', [ cls('nav-link') ], [ text(item('name')) ]); $app = el('div', [ cls('container my-5') ], [ el('h1', [], [ text('Repeat aka List')]), el('ul', [ cls('nav') ], [ repeat( read($items), item('id'), $item ), ]), ]);