cytoplasmic
    Preparing search index...

    Function For

    • Iterate over an array of items and render an element for each. When the cell updates the existing DOM-elements will be reused, but an update will be emitted for each item in the array.

      Type Parameters

      • TItem

      Parameters

      Returns Element

      const a = cell([1, 2, 3]);
      <For each={a}>{(item, index) => {
      <li>Item {item} and index {index}</li>
      }</For>
    • Iterate over a static array of items and render an element for each.

      Type Parameters

      • TItem

      Parameters

      Returns Element

      const a = [1, 2, 3];
      <For each={a}>{(item, index) => {
      <li>Item {item} and index {index}</li>
      }</For>
    • Iterate over a CellIterable of items and keys. See cellArray for information on creating dynamic cell arrays.

      Type Parameters

      • TItem
      • TKey

      Parameters

      Returns Element

      const a = cellArray([1, 2, 3]);
      <For each={a.indexed}>{(item, index) => {
      <li>Item {item} at index {index}</li>
      }</For>