Skip to content
nexubDesign System
v2.4.0

Components · Mobile only · Inputs

OTP Input

AlphaiOS & Android

One field drawn as cells, so SMS one-time-code autofill works on iOS and Android.

Usage

@nexub/react-native
import { OTPInput } from '@nexub/react-native';

<OTPInput label="Verification code" length={6} onComplete={verify} />

Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.

On device

OTP Input on iPhone (iOS simulator)

iPhone (iOS simulator)

OTP Input on Pixel (Android emulator)

Pixel (Android emulator)

Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.

OTPInput props

OTPInput props (React Native)
PropTypeDefaultDescription
labelrequiredstring—Accessible name, e.g. "Verification code".
lengthnumber6—
valuestring——
onValueChange(code: string) => void——
onComplete(code: string) => void—Called once all digits are entered.
secureboolean—Dots instead of digits (PIN). Turns off one-time-code autofill.
errorstring——
autoFocusboolean——
styleStyleProp<ViewStyle>——