Skip to content

A simple OTP input created with React and Typescript with tests using Jest and RTL.

Notifications You must be signed in to change notification settings

illianyh/react-ts-otpinput

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OTP input (React & Typescript)

There are tons of OTP (one-time password) or OTC (one-time code) inputs I have seen out there, but most of them are difficult to use or doesn't give me a great user experience. In this project, I tried my best to handle some of the issues that I can see when interacting with OTP inputs.

Features

  • Pasting value that has the same length as the OTP inputs
  • Using arrow keys: up, down, right and left
  • Changing a single input value without interrupting the placement of other input values

Quick Start

  1. Clone the app:
git clone git@github.com:illianyh/react-ts-otpinput.git
  1. Install dependencies:
cd react-ts-otpinput
yarn install
  1. Run the development server:
yarn start
  1. Open http://localhost:3000 to view it in the browser.

Running Tests (Watch)

yarn test

About

A simple OTP input created with React and Typescript with tests using Jest and RTL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published