Skip to content

Creating a 2FA verification pin field #5718

Answered by reidbarber
deltasierra96 asked this question in Q&A
Discussion options

You must be logged in to vote

Would utilizing a NumberField component with FocusScope or is there a better approach?

I think this is the right idea, but the downsides are that since there are multiple fields, you can't have autocomplete="one-time-code", pasting might not work, and it may be confusing to screen reader users.

It seems like it may be better to have one input, and use some styling tricks to make it visually appear like multiple inputs, like this: https://dev.to/madsstoumann/using-a-single-input-for-one-time-code-352l

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@deltasierra96
Comment options

Answer selected by deltasierra96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants