Structuresliemeobn.elementary 0.5.0Elementary
ForEach
An element that lazily renders HTML for each element in a sequence.
struct ForEach<Data, Content> where Data : Sequence, Content : HTML
Using ForEach
instead of for ... in
is potentially more efficient when rendering a large number of elements, as the result does not need to be collected into an array before rendering.
ForEach(1 ... 100) { index in
li { "Item \(index)" }
}