development
swift 22 lines 531 Bytes
Raw
1 import SwiftUI
2
3 struct KleponChip: View {
4 let title: String
5 var icon: String? = nil
6
7 var body: some View {
8 HStack(spacing: 6) {
9 if let icon {
10 Image(systemName: icon)
11 .font(.caption)
12 }
13
14 Text(title)
15 .font(KleponTypography.chip)
16 }
17 .foregroundStyle(KleponColor.textPrimary)
18 .padding(.horizontal, 12)
19 .padding(.vertical, 8)
20 .background(Capsule().fill(KleponColor.chipBackground))
21 }
22 }