BPKFlowStackView

public struct BPKFlowStackView<Data, Content> : View where Data : Collection, Content : View, Data.Element : Hashable

BPKFlowStackView is a SwiftUI view that arranges its children in a grid with a flexible number of columns and rows.

This view adjusts the number of columns based on the available width and the widths of the children. If a child does not fit in the current row, it is placed in the next row.

  • Creates an instance with the given spacing and content.

    Declaration

    Swift

    public init(
        data: Data,
        spacing: BPKSpacing = .md,
        alignment: HorizontalAlignment = .leading,
        content: @escaping (Data.Element, Int) -> Content
    )

    Parameters

    data

    The collection of data to be displayed

    spacing

    A BPKSpacing value indicating the space between children, with the same value for horizontal and vertical spacing.

    alignment

    The horizontal alignment of elements

    content

    The view builder closure used to render each data element

  • Declaration

    Swift

    public var body: some View { get }