KwikOutlinedOTP

fun KwikOutlinedOTP(onValidOTP: (TextFieldValue) -> Unit, size: Int = 6, isError: Boolean = false, error: String, visualTransformation: VisualTransformation = VisualTransformation.None, clearAll: Boolean = false, shape: Shape = MaterialTheme.shapes.small, colors: TextFieldColors = kwikOutlinedTextFieldColors(), onKeyboardDone: () -> Unit = { })

OTP input. The OTP field will automatically move focus to the next field when a digit is entered.

Parameters

onValidOTP

: Callback that is called when a valid OTP is entered. The TextFieldValue contains the OTP.

size

: The number of fields in the OTP. Default is 6.

isError

: If true, the error message will be displayed.

error

: The error message to display.

visualTransformation

: The visual transformation to apply to the OTP fields. Default is VisualTransformation.None. Pass in PasswordVisualTransformation for password masking.

clearAll

: If true, all OTP fields will be cleared.

onKeyboardDone

: Callback that is called when the user presses the done key on the keyboard.

Example usage:

KwikOTP(
onValidOTP = { otp ->
// handle valid OTP
},
error = "Invalid OTP"
)