InputOTP
Controlled 4–8 cell one-time-code input with numeric/alphanumeric validation, secure presentation, focus control, and completion callbacks.
InputOTP is a controlled one-time-code field.
Usage
const [code, setCode] = useState("");
<InputOTP
value={code}
onValueChange={setCode}
onComplete={(completedCode) => verify(completedCode)}
/>Length
length defaults to 6 and must be an integer from 4 through 8.
The controlled value cannot contain more characters than the configured length.

Character set
Built-in modes:
numeric -> 0–9
alphanumeric -> 0–9, A–Z, a–z<InputOTP
type="alphanumeric"
value={code}
onValueChange={setCode}
/>type defaults to "numeric".
Custom character validation
allowedChars replaces the character set derived from type and is evaluated per character:
<InputOTP
value={code}
onValueChange={setCode}
allowedChars={/[A-F0-9]/i}
/>Stateful g and y RegExp flags are handled safely by ARCUI.
Completion
onComplete runs when the controlled value becomes a complete valid OTP. The same code can complete again after first becoming incomplete.
blurOnComplete defaults to false and can release focus after successful completion.
Focus
autoFocus focuses the first available cell after mount.
The public ref exposes:
type TInputOTPRef = {
focus: () => void;
blur: () => void;
};focus() targets the first empty cell, or the last cell when the code is complete.
State and native props
disabled is the fully disabled semantic state. active={false} keeps ARCUI's inactive presentation while preventing interaction.
InputOTP exposes supported native TextInput props such as keyboard/autocomplete/accessibility configuration, while locking props that would conflict with OTP ownership, cell geometry, validation, and manual ARCUI font scaling.

Testing
Use testID where the public component contract exposes it so application tests can target the ARCUI-owned root without depending on visual implementation details. Component-specific stable descendants may use documented suffixes.
For provider setup and the dedicated react-native-arc-ui/testing entrypoint, see Testing.
API Reference
Also inherits: TextInputProps
| Prop | Type | Default | Description |
|---|---|---|---|
| ref? | Ref<TInputOTPRef> | — | Imperative InputOTP API. |
| value | string | required | Controlled OTP value. |
| onValueChange | (value: string) => void | required | Called whenever ARCUI resolves a new valid OTP value. |
| onComplete? | (value: string) => void | — | Called whenever the controlled value becomes a complete valid OTP. The same code can complete again after first becoming incomplete. |
| length? | number | 6 | Number of OTP cells. Must be an integer between 4 and 8. |
| secure? | boolean | false | Uses native secure text presentation for entered characters. |
| autoFocus? | boolean | false | Focuses the first available cell after mount. |
| blurOnComplete? | boolean | false | Blurs InputOTP after a complete valid code is resolved. |
| type? | TInputOTPType | "numeric" | Semantic OTP character set. numeric: 0-9 alphanumeric: 0-9, A-Z, a-z |
| allowedChars? | RegExp | — | Optional per-character validation override. When supplied, this replaces the character set derived from `type`. Stateful `g` and `y` flags are handled safely by ARCUI. |
| label? | string | — | — |
| error? | string | — | — |
| colors? | Readonly<IInputOTPColors> | — | — |
| disabled? | boolean | false | Fully disabled semantic state. |
| active? | boolean | true | Whether the field participates in the current interaction flow. |
| style? | StyleProp<ViewStyle> | — | Root component style. |
| testID? | string | — | — |
Per-instance color slots: IInputOTPColors
| Prop | Type | Default | Description |
|---|---|---|---|
| background? | Readonly<{
default?: TThemeColor;
disabled?: TThemeColor;
}> | — | — |
| border? | Readonly<{
empty?: TThemeColor;
filled?: TThemeColor;
focused?: TThemeColor;
error?: TThemeColor;
inactive?: TThemeColor;
disabled?: TThemeColor;
}> | — | — |
| text? | Readonly<{
default?: TThemeColor;
disabled?: TThemeColor;
}> | — | — |
| label? | Readonly<{
default?: TThemeColor;
disabled?: TThemeColor;
}> | — | — |
| error? | TThemeColor | — | Shared validation color used by the label/error presentation. Border error color remains independently overrideable through border.error. |
Generated from the ARCUI 2.0.0 TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.
Generated from the ARCUI 2.0.0 TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.
The generated table above covers ARCUI-owned public props from the source-aligned type snapshot. Native inherited surfaces remain available where the public type extends React Native props.
Motion
Cell focus/error/disabled presentation uses ARCUI/Reanimated visual state while the actual OTP string remains controlled React state.
See Motion for the library-wide model.
Performance
Keep application semantics at normal React update cadence. ARCUI components avoid using React state as a frame-by-frame animation driver; use the component callbacks and let Reanimated own continuous visual work.
See Performance for broader guidance.
Accessibility
ARCUI uses native roles, labels, semantic accessibility state, centralized font scaling, and localizable ARCUI-owned strings where the component owns behavior text. Consumer accessibility overrides remain available when they do not conflict with component correctness.
See Accessibility for the library-wide model.
Theming
This component resolves its normal presentation from ARCUI tokens and active theme context. Prefer token configuration for system-wide design changes and component props for genuine instance-level exceptions.
Relevant token areas include:
colors.*.inputOTP
sizings.inputOTP
radius.inputOTP
border.inputOTP
typography.inputOTP
animationsTop-level token overrides are shallow. Compose changed built-in namespaces from defaultTokens rather than relying on recursive merge behavior.
Try it live
Open the existing React Native Snack to explore InputOTP interactively.

