Back to Library
Verification Code View

Verification Code View

by Luiz Mello

@luizmellodev
inputgradientui

Description

A simple but beautiful verification code view

SwiftUI Code

struct OTPVerificationView: View, ViewTemplate {
    let id = "otpverification"
    let name = "OTP Verification"
    
    var view: AnyView {
        AnyView(self)
    }
    
  @State private var otpCode: [String] = Array(repeating: "", count: 4)
  @State private var currentField: Int = 0
  @FocusState private var fieldFocus: Int?
  
  var body: some View {
      VStack(spacing: 32) {
          // Icon
          ZStack {
              Circle()
                  .fill(Color.blue.opacity(0.1))
                  .frame(width: 80, height: 80)
              

// ... (click "Show full code" to see more)
Viewing: OTPVerificationView.swift1 of 2