React Native OTP Input for Expo

Install

OTP Input · Verify Phone, native in Expo Go — the other variants are a tap away. No account needed.

Needs Expo Go for SDK 58 — update from the App Store or Play Store.

Digits pop into cells that size themselves, with SMS autofill and paste.

iOS · Android · Expo Go
9:41

Installation

One command copies the source into your app — you own the code and can change anything.

After you add the file, import it like any local component:

App.tsx
import { OtpInput } from "@/components/ui/otp-input";

Or add it with the CLI (installs any missing peers):

Usage

Colours, radius and light / dark come from useKit(). Wrap your app in <KitProvider accent="#6366f1" radius={14}> to re-skin every component at once.

Like this? There's a lot more in Pro Pro

12 full screens built from the same kit — install them the same way.

See what's in Pro

Props

PropTypeDefault
length

Number of cells.

number6
value / onChangeText

Controlled code (digits only). Pasting a longer string fills every cell.

string—
onComplete

Called when every cell is filled.

(code) => void—
variant

Rounded box cells, underline bars, or round pill cells.

"box" | "underline" | "pill""box"
error

Shakes the row and turns it the danger colour.

booleanfalse
errorText

Message (with icon) shown under the cells while `error` is set.

string—
success

Success colour with a staggered pulse across the cells.

booleanfalse
successText

Message with an animated check shown while `success` is set.

string—
helperText

Hint shown under the cells otherwise.

string—
separatorAfter

Draw a dash after this many cells, e.g. 3 → 123 – 456.

number—
maxCellSize

Largest cell width; cells shrink to fit the row and never overflow.

number52
secure

Dots instead of digits.

booleanfalse
disabled

Dims and blocks input.

booleanfalse
autoFocus

Focus on mount.

booleanfalse
accent

Active cell colour.

stringtheme accent
style

Style for the root view around the cells and message.

StyleProp<ViewStyle>—
className

Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides.

string—

Customization

You own the source file — tune appearance with props (no fork required for most tweaks). For brand-wide colours and radius, wrap your app in KitProvider; for one-off looks, use the style props below.

Design theme

Open Design theme on the live preview — accent, corner radius and font update every variant instantly (same as KitProvider in your app).

Variants

Pick the Variants chip above the preview, or set variant=… — "box" | "underline" | "pill".

Style props

React Native style and typed slots like fieldStyle, plus optional root className when you use NativeWind or Uniwind (cnProps from kit).

variant
"box" | "underline" | "pill" · default "box"Rounded box cells, underline bars, or round pill cells.
accent
string · default theme accentActive cell colour.
style
StyleProp<ViewStyle>Style for the root view around the cells and message.
className
stringTailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides.

Map tokens from your design system on Bring your design system or read Theming for KitProvider and NativeWind / Uniwind setup.

Behaviour & accessibility

Touch
Tapping the row focuses one hidden number-pad input. Pasting a code like 123-456 strips the non-digits and fills every cell.
Motion
Digits pop in on a bouncy spring and the active cell glows with a halo and a blinking caret. Errors shake the row; success pulses across the cells.
Platforms
Sets textContentType 'oneTimeCode' and autoComplete 'one-time-code', so codes from SMS can autofill.
Screen readers
The cells are hidden; the input is labelled 'One-time code, 6 digits' with a hint. Helper, error and success messages are a polite live region.
Web
The browser focus outline is removed; the border and halo show focus instead.

Source

FAQ

How do I make an OTP input in React Native?
Use ExpoKit's OTP Input: run npx @expokit/cli@latest add otp-input in your Expo or React Native project and it copies a ready-made OTP input into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.
Does OTP Input work in Expo Go?
Yes. OTP Input runs in Expo Go on iOS and Android with no development build — its packages (react-native-svg) are all included in Expo Go.
How do I add OTP Input to my Expo app?
Run npx @expokit/cli@latest add otp-input in your project. The CLI copies the component's source into your app and installs react-native-svg, so the code is yours to change.
Is OTP Input free?
Yes. OTP Input is free: its full source is on this page and the CLI installs it without an account.
Can I change how OTP Input looks?
Yes. It takes its colours, radius and light / dark mode from useKit(), so wrapping your app in <KitProvider accent radius> re-skins it with every other ExpoKit component. The code lives in your project, so you can also edit anything directly.