Launch sale — 60% off Pro
Contact
Input OTPVariants

Not affiliated with official shadcn/ui. Visit ui.shadcn.com for official docs.

React Input OTP - Numeric Only OTP

A React numeric-only OTP input with REGEXP_ONLY_DIGITS pattern and inputMode numeric for mobile keyboard optimization built with shadcn/ui InputOTP

Looking to implement shadcn/ui patterns?

Join our Discord community for help from other developers.


Alphanumeric keyboards slow down code entry on mobile. This React pattern shows InputOTP with REGEXP_ONLY_DIGITS pattern and inputMode set to numeric—triggers mobile numeric keypad for faster entry. Built with shadcn/ui InputOTP and input-otp REGEXP_ONLY_DIGITS constant, it's perfect for SMS verification, email codes, numeric PINs, authenticator apps, banking codes, or any verification where codes are digits-only and mobile-optimized keyboard improves speed and reduces errors.

Numeric keyboard on mobile devices.

Pattern created by @haydenbleasel

Installation

Questions you might have