layout/DSChipGroup
DSChipGroup
layoutHorizontal container for chips with consistent spacing.
iOSmacOS
Purpose
Groups multiple chips together with uniform spacing. Simplifies layout when displaying multiple filter or tag chips.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| spacing | CGFloat | DSSpacing.sm | Space between chips |
| contentreq | ViewBuilder | โ | Chip content |
Examples
Chip group
Group of chips with custom spacing.
swift
DSChipGroup(spacing: DSSpacing.md) {
DSChip("All", variant: .filled, isSelected: filter == "All") { filter = "All" }
DSChip("Active", variant: .filled, isSelected: filter == "Active") { filter = "Active" }
DSChip("Done", variant: .filled, isSelected: filter == "Done") { filter = "Done" }
}Usage Guidelines
- Use to maintain consistent spacing between chips
- Wrap in ScrollView for horizontal scrolling when needed
- Consider using FlowLayout for wrapping chips across multiple lines