layout/DSFlowLayout

DSFlowLayout

layout
since 0.1.0

Wrapping layout that automatically flows children onto new lines when horizontal space is exhausted.

iOS 17+macOS 14+watchOS 10+tvOS 17+visionOS 1+

Purpose

Tag clouds, skill chips, filter groups, and any variable-width content row.

Interactive Reference

Live showroom

Need the full visual surface?

Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().

Best for exploring:

variants, states, categories, and real app examples in one place.

Props

PropTypeDefaultDescription
datareqData (RandomAccessCollection)—Items to lay out (first, unlabeled argument). Elements must be Hashable.
spacingCGFloatDSSpacing.smGap between items and between rows.
contentreq@ViewBuilder (Data.Element) -> Content—Builds the view for each element.

Examples

Skills tag cloud

Auto-wrapping tags on a profile card.

swift
DSFlowLayout(["SwiftUI", "iOS", "Design", "Accessibility", "Animation"], spacing: DSSpacing.xs) { skill in
    DSTag(skill)
}

Related Components