Skip to content

OTP verification

Title, description, code field, verifying row, resend and actions in one block for screens, sheets and dialogs.

OTP verification OTP verification

JengaOtpVerification(
    title = "Enter the code",
    description = AnnotatedString(
        text = "We sent a 6-digit code to +254 712 345 678",
    ),
    field = {
        JengaOtpField(
            value = code,
            onValueChange = { code = it },
            contentDescription = "Verification code",
            onComplete = {
                verify(
                    it,
                )
            },
        )
    },
    verifying = verifying,
    verifyingText = "Verifying…",
    resend = {
        JengaOtpResend(
            remaining = remaining,
            onResend = {},
            countdownText = "…",
            resendText = "Resend code",
        )
    },
)