Homelogologo
Sponsor

For

A utility component for rendering a list of items.

Usage

Provides a clean way to iterate over an array and render its items. It also supports a fallback UI when the array is empty.

import { For } from "@elemnts-ui/react" <For each={items} fallback={<p>No items found.</p>}> {(item, index) => <div key={index}>{item}</div>} </For>

Examples

Fallback

The fallback prop allows you to render content when the each array is empty or undefined.

API Reference

PropTypeDefault
eachT[] | readonly T[]undefined
fallbackReactNode-
children(item: T, index: number) => ReactNode-