When micro-interaction makes great UX

28 August 2020

React Native sms text input validation
Photo by jamie452

When dealing with SMS validation code form, don't forget to add the autocomplete attribute with the value "one-time-code".

It allows iOS to autofill the input with the incoming SMS.

For iOS 12+ oneTimeCode can be used to indicate that a field can be auto-filled by a code arriving in an SMS.

import { TextInput } from 'react-native';

<TextInput
textContentType="oneTimeCode"
...
/>

Gravatar for dleuliette@gmail.com

Hi, I’m David, a french freelance developer working remotely. I’m the author of this blog, nice to meet you!

Subscribe?

Be the first to receive insightful articles and actionable resources that help you to elevate your skills across every touch point.