One-time code

An OTP input for React that looks like separate boxes but behaves as one field. Pasting a code, browser autofill and backspace all work as you would expect. Choose four or six digits, adjust the corners, and set whether a full code is accepted or rejected. Made for two-factor sign in, phone verification and password reset screens.

One-time code, at rest

Type · free, with full source

One-time code props

NameTypeDefaultDescription
answerstring"Accept"What a full code gets back. One of Accept, Reject.
lengthstring"4"Length. One of 4, 6.
cornernumber12pxCorner. From 0 to 22px.

Free under MIT. Licence

More blocks

More type blocks