data-display/DSTag

DSTag

data-display
since v1.0

Removable label with a custom colour, used for categorisation and filtering.

iOS 17+macOS 14+

Purpose

User-generated categories, filters, and skill tags.

Props

PropTypeDefaultDescription
labelreqStringTag text.
colorColorDSColor.primaryTag accent colour.
onRemove(() -> Void)?nilShows × button when provided.

Examples

Filter tags

Active filters in a search screen.

swift
HStack {
    ForEach(activeFilters) { filter in
        DSTag(filter.name, color: filter.color) {
            viewModel.removeFilter(filter)
        }
    }
}

Related Components