layout/DSFlowLayout
DSFlowLayout
layoutWrapping 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
| Prop | Type | Default | Description |
|---|---|---|---|
| spacing | CGFloat | DSSpacing.sm | Gap between items. |
| lineSpacing | CGFloat | DSSpacing.sm | Gap between rows. |
| contentreq | ViewBuilder | โ | 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)
}
}