Skip to content
OwnlyPlans

Element

Verification Code Input

Six-box one-time code field with paste, SMS autofill, auto-advance, backspace and arrow keys, an error shake and a resend timer.

Remix

Preview and code

Markdown
Other

Install

shadcn CLI
npx shadcn@latest add https://ownlyplans.com/r/bhaskar/verification-code-input.json

Adds the React files to components/ownlyplans/ in a project set up with shadcn and Tailwind CSS. Or copy them from the Code tab.

About

The code screen after sign-up or two-factor login, done properly. Typing moves to the next box, Backspace goes back, the arrow keys move between boxes, and pasting “123 456” (or letting the phone autofill the SMS code) fills every box at once. Only digits are accepted.

When all six digits are in, it checks the code: a wrong code shakes the boxes and says so, a right one turns them green. The resend link counts down so people do not spam it. In the preview the right code is 123456. In the React version pass verify(code) that calls your API and resolves true or false.

MIT License

Copyright (c) 2026 OwnlyPlans

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Your AI tool
Starter prompt

		

Download the plan