Stop Rebuilding UI

Shadcn.io is not affiliated with official shadcn/ui

OTP with Paste Optimization

A React OTP input with dedicated paste button using Clipboard API to read and filter pasted codes built with shadcn/ui InputOTP and Button

Users copy OTP codes from SMS but struggle pasting into individual slots—manual typing wastes time. This React Button with ClipboardPaste icon reads navigator.clipboard, strips non-digits with regex, slices to 6 characters, and sets InputOTP value—one-click paste flow. Built with shadcn/ui InputOTP, Button, Lucide React icons, and Clipboard API, it's perfect for SMS verification codes, email authentication, authenticator app codes, or any OTP flow where users receive codes externally and explicit paste button improves success rate over native paste behavior.

OTP with Paste Optimization preview

Scroll to load preview

Installation

FAQ

Was this page helpful?

Sign in to leave feedback.