CHResume/ResumeBuilder/Generic Elements/TagView.swift
Christoph Hagen bd87a4fb6f First version
2023-08-18 22:47:24 +02:00

34 lines
696 B
Swift

import SwiftUI
struct TagView: View {
let text: String
let rounding: CGFloat
let color: Color
init(_ text: String, rounding: CGFloat, color: Color) {
self.text = text
self.rounding = rounding
self.color = color
}
var body: some View {
Text(text)
.fontWeight(.light)
.padding(.horizontal, rounding)
.padding(.vertical, 3)
.background(
RoundedRectangle(cornerRadius: rounding)
.fill(color)
)
}
}
struct TagView_Previews: PreviewProvider {
static var previews: some View {
TagView("Text", rounding: 8, color: .gray)
}
}