shaffex

List is a container that presents rows of data arranged in a single column, similar to UITableView in UIKit but with a more declarative and simpler syntax. It’s commonly used for displaying a collection of items in a structured format and supports features like selection, deletion, and reordering of items if needed.

Parameters:

listStyle (optional) This parameter determines the horizontal alignment of the views within the VStack. It’s of type HorizontalAlignment and can take the following values:

Default value: automatic

<body>
    <list>
        <text>Item 1</text>
        <text>Item 2</text>
        <text>Item 3</text>
        <text>Item 4</text>
        <text>Item 5</text>
    </list>
</body>

Screenshot


grouped List

<body>
    <list listStyle="grouped">
        <text>Item 1</text>
        <text>Item 2</text>
        <text>Item 3</text>
        <text>Item 4</text>
        <text>Item 5</text>
    </list>
</body>

Screenshot


insetGrouped List

<body>
    <list listStyle="insetGrouped">
        <text>Item 1</text>
        <text>Item 2</text>
        <text>Item 3</text>
        <text>Item 4</text>
        <text>Item 5</text>
    </list>
</body>

Screenshot


List with sections

<body>
    <list>
        <section header="Section 1 Header" footer="Section 1 Footer">
            <text>Item 1</text>
            <text>Item 2</text>
            <text>Item 3</text>
            <text>Item 4</text>
            <text>Item 5</text>
        </section>
        <section header="Section 2 Header" footer="Section 2 Footer">
            <text>Item 1</text>
            <text>Item 2</text>
            <text>Item 3</text>
            <text>Item 4</text>
            <text>Item 5</text>
        </section>
    </list>
</body>

Screenshot