For Loops

Use for to repeat a component tree for every item in a collection. The collection is a Rust path; inside the loop, use $item bindings to place each item's data in properties.

UnorderedList {
    for item in items {
        ListItem {
            text: $item.title
        }
    }
}

Loop contents can contain other components, if statements, and nested loops.

Column {
    for section in sections {
        Header2 { text: $section.title }

        for item in section.items {
            Link {
                text: $item.title
                href: $item.href
            }
        }
    }
}