layout/DSChipGroup

DSChipGroup

layout
since 1.2.0

Horizontal 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

PropTypeDefaultDescription
spacingCGFloatDSSpacing.smSpace between chips
contentreqViewBuilderโ€”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

Related Components