CHResume/ResumeBuilder/Generic Elements/TagView.swift

34 lines
696 B
Swift
Raw Normal View History

2023-08-18 22:47:24 +02:00
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)
}
}