
Icon Tags
From syxUI — written for both platforms, not translated between them.
Icon-and-label tags.
Badges · SwiftUI · iOS 17
- badges
- swiftui
The actual source
IconTags.swift
// Icon Tags · syxUI · https://syxui.dev/components/tag-icon
// Free in any project. Keep this line and credit syxUI where a person can read it.
import SwiftUI
let tgBlue = Color(red: 0.0, green: 0.47, blue: 1.0)
let tgGreen = Color(red: 0.16, green: 0.66, blue: 0.40)
let tgRed = Color(red: 0.90, green: 0.24, blue: 0.28)
// Icon + label tags
struct IconTags: View {
var body: some View {
HStack(spacing: 8) {
ForEach(Array([("mappin", "Nearby", tgRed), ("clock", "12 min", tgBlue), ("leaf.fill", "Vegan", tgGreen)].enumerated()), id: \.offset) { _, t in
HStack(spacing: 4) { Image(systemName: t.0).font(.system(size: 11)); Text(t.1).font(.system(size: 13, weight: .medium)) }.foregroundStyle(t.2).padding(.horizontal, 10).padding(.vertical, 6).background(t.2.opacity(0.12), in: Capsule())
}
}
}
}
iOS 17 · No dependencies
Dependencies
- SwiftUI
- No external dependencies
Requires iOS 17

