Skip to main content
196

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Android docs
FormsAndroid

Input OTP

Enter numeric verification codes with native paste and autofill integration.

Public APILumenInputOTPAndroid / Compose

Native example

Use Input OTP

The application verifies codes and owns submission. Normalize localized digit input into ASCII; reject invalid or excess input without truncating. Never send or persist credentials from the component.

Input OTP rendered in the Android phone emulator Lumen playground
Captured exampleAndroid phone emulator
kotlin
LumenInputOTP(
    label = "Verification code", value = code,
    onValueChange = { code = it }, length = 6,
    description = "Enter or paste six digits"
)

Reference

Public API

The primary shared and platform-specific options exposed by LumenInputOTP.

APIValues or typeDefaultDescription
label / value / onValueChangeString / String / (String) -> UnitRequiredNames the field and controls an ASCII digit value.
modifierModifierModifierApplies layout and semantics.
lengthInt6Sets a bounded code length from one through twelve.
description / errorMessageString?nullProvides translated help or validation.
maskedBooleanfalseHides displayed digits and applies password semantics.
onComplete((String) -> Unit)?nullReports a newly completed edit without verifying or submitting.
enabled / readOnlyBooleantrue / falseControls native editing.

Native behavior

Design and accessibility

When to use it

The application verifies codes and owns submission. Normalize localized digit input into ASCII; reject invalid or excess input without truncating. Never send or persist credentials from the component.

Accessibility

Uses one native input for paste, selection, deletion, and SMS code autofill; supports errors and optional masking.

Shared component

Available on other platforms

React NativeApple / SwiftUI
Android docsCompose module