Stop Rebuilding UI

Shadcn.io is not affiliated with official shadcn/ui

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

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 Only OTP preview

Scroll to load preview

Installation

FAQ

Was this page helpful?

Sign in to leave feedback.