rci
is a React component that ask for a one time password, in a pretty clever way.
rci
uses a single DOM input element, overlayed on top of plain divs for styling.Most other implementations of this pattern are based on multiple inputs. Using multiple inputs gives out-of-the-box style consistency, but comes with the disadvantage of JavaScript hacks to deal with focus shifting and pasting, and accessibility issues.
By starting from one input, rci
can also make use of autocomplete="one-time-code"
to autocomplete one-time passwords.