layout/DSFlowLayout

DSFlowLayout

layout
since v1.0

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

iOS 17+macOS 14+

Purpose

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

Props

PropTypeDefaultDescription
spacingCGFloatDSSpacing.smGap between items.
lineSpacingCGFloatDSSpacing.smGap between rows.
contentreqViewBuilderโ€”Flow children.

Examples

Skills tag cloud

Auto-wrapping skill tags on a profile card.

swift
DSFlowLayout(spacing: DSSpacing.xs) {
    ForEach(skills) { skill in
        DSTag(skill.name, color: skill.color)
    }
}

Related Components