ClerkCodeInputField

fun ClerkCodeInputField(onTextChange: (String) -> Unit, onClickResend: () -> Unit, modifier: Modifier = Modifier, timerDuration: Int = DEFAULT_TIMER_LENGTH, verificationState: VerificationState = VerificationState.Default, showResend: Boolean = true, clerkTheme: ClerkTheme? = null)

A specialized input field component for entering one-time passwords (OTP) or verification codes.

This component displays a row of individual boxes for each digit of the code, with visual feedback for different states including error, success, and verification in progress. It includes automatic resend functionality with a countdown timer.

Parameters

onTextChange

Callback invoked when the OTP text changes. Receives the current OTP string.

onClickResend

Callback invoked when the user clicks the resend code link.

modifier

Optional Modifier to be applied to the component.

timerDuration

The duration of the countdown timer in seconds for resending the code. Defaults to DEFAULT_TIMER_LENGTH.

verificationState

The current state of the verification process (e.g., Default, Verifying, Success, Error). Defaults to VerificationState.Default.

showResend

Whether to show the resend code link and timer. Defaults to true.