FlowStackLayout
SwiftUI wrapping stack implementation using Layout protocol (iOS 16+)
Install / Use
/learn @smyshlaevalex/FlowStackLayoutREADME
FlowStackLayout
FlowStack acts like a HStack until there are no more space for new cells, then FlowStack will wrap to the next row
FlowStack supports vertical and horizontal alignment
Horizontal alignment will align rows
Vertical alignment will align cells based on row height
FlowStackLayout conforms to Layout protocol, while FlowStack conforms to View and wraps FlowStackLayout
View modifiers can't be used with Layout protocol, so FlowStack is preferred for normal use
FlowStack(alignment: Alignment = .center, horizontalSpacing: Double? = nil, verticalSpacing: Double? = nil, content: @escaping () -> Content)
FlowStack {
ForEach(0...20, id: \.self) {
Text(String($0))
.foregroundColor(Color(uiColor: .systemBackground))
.padding([.leading, .trailing])
.frame(height: 30)
.background {
Capsule()
.fill(.mint)
}
}
}
FlowStackLayout(alignment: Alignment = .center, horizontalSpacing: Double? = nil, verticalSpacing: Double? = nil)
let layout = isVertical ? AnyLayout(VStack()) : AnyLayout(FlowStackLayout())
layout {
}
Installation
Swift Package Manager
https://github.com/smyshlaevalex/FlowStackLayout.git
Related Skills
node-connect
349.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
