You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose adding a reusable OTPInput component tailored for React Native apps.
This component is inspired by the ShadCN web implementation but adapted for mobile, focusing on usability, keyboard behavior, and mobile UX patterns.
Motivation
OTP inputs are widely used in authentication flows. Adding this component will:
Standardize OTP input handling across mobile apps
Reduce duplication in projects
Provide a robust, tested mobile-first solution for React Native developers
Features
Custom length: Supports any number of digits via maxLength
Auto-focus & backspace handling: Moves focus as the user types and deletes
Numeric keyboard support: Optimized for mobile numeric entry
Paste handling: Can process pasted OTPs via a pasteTransformer
Validation callback: Fires onComplete when OTP is fully entered
Context-based rendering: InputOTP, InputOTPGroup, InputOTPSlot for flexible UI
Styling flexibility: Supports container and input styles
Fake caret and focus indicators: Enhances user experience on mobile
Accessible API: Compatible with React Native’s TextInputProps
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I propose adding a reusable
OTPInputcomponent tailored for React Native apps.This component is inspired by the ShadCN web implementation but adapted for mobile, focusing on usability, keyboard behavior, and mobile UX patterns.
Motivation
OTP inputs are widely used in authentication flows. Adding this component will:
Features
maxLengthpasteTransformeronCompletewhen OTP is fully enteredInputOTP,InputOTPGroup,InputOTPSlotfor flexible UITextInputPropsExample usage
Props as per now
Implementation Notes
Questions / Feedback Requested
Next Steps
If approved, I can submit a PR with:
onComplete,Beta Was this translation helpful? Give feedback.
All reactions