data-display/DSTag
DSTag
data-displayRemovable label with a custom colour, used for categorisation and filtering.
iOS 17+macOS 14+
Purpose
User-generated categories, filters, and skill tags.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| labelreq | String | — | Tag text. |
| color | Color | DSColor.primary | Tag accent colour. |
| onRemove | (() -> Void)? | nil | Shows × 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)
}
}
}