Advanced / JSX Component Primitives

repeat

Reactively renders a callback count times, reusing previously-rendered entries when only the count changes. Underlying helper for <Repeat>.

  • options.from — start index (default 0); useful for offset/windowed rendering.
  • options.fallback — accessor returning a value to show when count is 0.

Import

import { repeat } from "solid-js";

Type signature

function repeat(
count: Accessor<number>,
map: (index: number) => any,
options?: {
from?: Accessor<number | undefined>;
fallback?: Accessor<any>;
name?: string;
}
): Accessor<any[]>;

Examples

const view = repeat(count, (i) => `Item ${i}`, { fallback: () => "empty" });
Last updated: 7/4/26, 6:21 PMEdit this pageReport an issue with this page