TTBaseSUIGroup
LayoutA Group wrapper that optionally adds background, corner radius, and padding. Useful for semantic grouping of related views and for building card-style section containers without nesting extra VStack + background calls.
🚀 Usage
// Init 1: Transparent group — pure semantic grouping
TTBaseSUIGroup {
TTBaseSUIText(withType: .TITLE, text: "Row A", align: .leading, color: TTView.textDefColor.toColor())
TTBaseSUIText(withType: .TITLE, text: "Row B", align: .leading, color: TTView.textDefColor.toColor())
}
// Init 2: With background color
TTBaseSUIGroup(bg: .white) {
SomeView()
}
// Init 3: bg + corner radius (card style)
TTBaseSUIGroup(bg: .white, radius: TTSize.CORNER_PANEL) {
TTBaseSUIVStack(alignment: .leading, spacing: 8) {
TTBaseSUIText(withBold: .TITLE, text: "Section Title", align: .leading, color: TTView.textTitleColor.toColor())
TTBaseSUIHorizontalDividerView(noConner: .LINE)
TTBaseSUIText(withType: .SUB_TITLE, text: "Body content.", align: .leading, color: TTView.textSubTitleColor.toColor())
}
}
.baseShadow()
.maxWidth(alignment: .leading)
// Init 4: bg + radius + inner padding
TTBaseSUIGroup(bg: .white, radius: TTSize.CORNER_PANEL, padding: TTSize.P_CONS_DEF) {
RowView()
RowView()
RowView()
}
.baseBorder(radius: TTSize.CORNER_PANEL)
📖 Inits & Properties
| Init | Parameters | Use Case |
|---|---|---|
| 1 | content | Transparent group — semantic only |
| 2 | bg, content | Colored background |
| 3 | bg, radius, content | Card with rounded corners |
| 4 | bg, radius, padding, content | Full card with inner padding |
Pro Tip: Chain
.baseShadow() after TTBaseSUIGroup for a consistent card shadow, or .baseBorder(radius:) for a bordered variant. The setCorner(radius:) extension lets you dynamically adjust the corner radius after init.