Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
struct AquaSearchFieldView: View {
let leftLabelText: String
let placeholderText: String
@State var text = ""
var body: some View {
HStack {
Text(leftLabelText)
ZStack {
Capsule()
.foregroundColor(.white)
Capsule()
.stroke(lineWidth: 3)
.offset(y: 1)
.foregroundColor(.gray)
HStack {
Text("🔍")
.padding(.leading, 10)
TextField("\(placeholderText)", text: $text)
.font(.caption2)
.frame(maxWidth: .infinity, alignment: .leading)
}
}
.clipShape(Capsule())
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment