RORK LABJP
FUNDING — Rork closed a $15M seed round led by Left Lane Capital, with Peak XV, True Ventures, Goodwater, and a16z SpeedrunUSERS — Rork now reaches 2M users with 743K monthly visits and an 85% growth rateMAX — Rork Max generates native Swift apps for iPhone, iPad, Watch, TV, Vision Pro, and iMessageSTACK — Standard Rork builds iOS and Android together in React Native (Expo), so non-engineers can ship real appsPRICE — Plans start free, paid tiers from $25/month, and Rork Max at $200/monthMARKET — Gartner projects 75% of new apps will be low-code or no-code by the end of 2026FUNDING — Rork closed a $15M seed round led by Left Lane Capital, with Peak XV, True Ventures, Goodwater, and a16z SpeedrunUSERS — Rork now reaches 2M users with 743K monthly visits and an 85% growth rateMAX — Rork Max generates native Swift apps for iPhone, iPad, Watch, TV, Vision Pro, and iMessageSTACK — Standard Rork builds iOS and Android together in React Native (Expo), so non-engineers can ship real appsPRICE — Plans start free, paid tiers from $25/month, and Rork Max at $200/monthMARKET — Gartner projects 75% of new apps will be low-code or no-code by the end of 2026
Articles/App Dev
App Dev/2026-07-05Intermediate

Building a One-Time Code Field in Expo — SMS Autofill and Segmented Display Together

A six-digit verification screen looks trivial, but once you account for SMS autofill, pasting, and deleting one digit at a time, it needs real care. Here is how to nail the iOS and Android autofill first, then build a segmented look on top of a single TextInput that does not break.

Rork488Expo129React Native195Authentication8UX Design9

Premium Article

When I added phone verification to one of my apps, my first attempt was the obvious one: six TextInputs sitting side by side. It looked tidy, but the feedback arrived fast. "The code from the SMS never shows up above the keyboard." "When I paste, only the first box fills in." The moment I split the field into boxes, I had quietly broken both iOS autofill and clipboard paste. As an indie developer shipping several apps to the App Store, this one screen — the verification code field — is something I have rebuilt more times than I would like to admit.

A code entry screen sits right before sign-up or payment, exactly where you least want people to drop off. A single moment of friction here loses someone who was already interested. Let me walk through building an input in Expo (React Native) where SMS autofill, pasting, and deleting all feel natural.

Splitting into boxes cuts off autofill

The first snag in a code field is the mismatch between how it looks and how input actually works. Visually you want each digit in its own box. But OS autofill treats one field as the target and tries to drop the whole six-digit string into it.

Split that into six TextInputs and iOS cannot decide which field to inject into, so the keyboard suggestion (the code chip) never appears at all. Android's SMS autofill assumes a single field too. Paste lands only in the one focused box.

That leads to a single guiding principle: split the appearance, keep the input as one. Place a single transparent TextInput, then draw its value one character at a time so it reads as a row of boxes.

Set the autofill attributes first

Lock down autofill before anything else. Leave it for later and you will build the whole UI, then lose an afternoon to "why is the suggestion not showing." The required attributes differ by OS.

GoaliOSAndroid
Code autofilltextContentType="oneTimeCode"autoComplete="sms-otp"
Keyboard typekeyboardType="number-pad" (for numeric codes)
Suppress autocorrectautoCorrect={false}; let textContentType take priority

One caution: copying an importantForAutofill value from an old blog post can actually make Android ignore sms-otp. Start from the minimal setup above and add attributes only when you truly need them.

import { TextInput } from "react-native";
 
// The single real input. It stays transparent because the boxes are drawn separately
<TextInput
  value={code}
  onChangeText={handleChange}
  keyboardType="number-pad"
  textContentType="oneTimeCode" // iOS: surfaces the SMS code as a suggestion
  autoComplete="sms-otp"        // Android: SMS autofill
  maxLength={6}
  autoFocus
  style={{ position: "absolute", opacity: 0 }}
/>

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
The correct way to make iOS textContentType=oneTimeCode and Android autoComplete=sms-otp both fire
The pattern of looking like six boxes while actually being one TextInput, so autofill and paste keep working
Key handling that survives both a full six-digit paste and deleting one character at a time
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

App Dev2026-06-27
Before You Ask 'Are You Sure?' — Consider an Undoable Delete
Showing a confirmation dialog every time someone removes a list item trains them to tap OK without reading. Here is how to build an undoable delete in a Rork (Expo) app, and where confirmation dialogs still belong.
App Dev2026-06-29
Clipboard UX in Expo apps — copy and paste without flooding users with iOS's paste banner
When you wire up copy and paste with expo-clipboard, iOS's paste permission banner can fire constantly and quietly erode trust. Here's exactly when the banner appears, and how hasStringAsync lets you gate a Paste button without ever reading the contents.
App Dev2026-06-27
Your Animation Keeps Running After You Leave the Screen — Focus-Aware Battery Savings in a Rork (Expo) App
In a Rork-generated Expo app, a gradient or breathing animation can keep running after you push another screen or background the app, quietly draining the battery without ever surfacing as jank. The cause is that Reanimated's withRepeat lives on the UI thread and the navigation stack keeps screens mounted. This shows a lifecycle design — useIsFocused plus AppState — that reliably stops off-screen and background loops, with working code.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →