Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OtpInput] Add a hook, support OTP/ PinInput usePinInput #75

Open
marcpachecog opened this issue Jan 16, 2024 · 5 comments
Open

[OtpInput] Add a hook, support OTP/ PinInput usePinInput #75

marcpachecog opened this issue Jan 16, 2024 · 5 comments
Labels
new feature New feature or request

Comments

@marcpachecog
Copy link
Contributor

marcpachecog commented Jan 16, 2024

Summary

I believe it would be fantastic to introduce a base-ui hook specifically designed for handling OTP inputs.
Chakra already offers a PinInput component along with a headless UI hook in their Zag library (https://zagjs.com/components/react/pin-input).

Examples

No response

Motivation

No response

Search keywords:

Features to support

  • Past from plain string, e.g. pasting 990312 on mobile should fill the whole component.
  • Caret should be managed as if it was a single <input>.
  • Be 6 pins by default, most common use case is 2FA
  • Submit form after past when pressing Enter

Benchmarks

@marcpachecog marcpachecog added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 16, 2024
@DiegoAndai DiegoAndai removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 16, 2024
@michaldudak michaldudak removed their assignment Jan 17, 2024
@michaldudak
Copy link
Member

👍 Let's wait for the community upvotes so we can prioritize this.

@oliviertassinari oliviertassinari changed the title [base-ui] Add a hook to manage OTP Inputs usePinInput [base-ui] Add a hook, support OTP/ PinInput usePinInput Jan 17, 2024
@oliviertassinari
Copy link
Member

I have added a few benchmarks.

2FA grew in popularity recently, and so did this component. I wonder about the impact passwordless (biometric, passkey, device, email link) authentification will have though.

@TheOneTheOnlyJJ
Copy link

TheOneTheOnlyJJ commented Feb 3, 2024

It would be great to have this in Material UI as well, not only here in Base UI.

@michaldudak michaldudak transferred this issue from mui/material-ui Feb 27, 2024
@oliviertassinari
Copy link
Member

oliviertassinari commented Feb 27, 2024

@michaldudak before we transfer issues, we need to create the labels. We loose all of that data otherwise.

@michaldudak michaldudak changed the title [base-ui] Add a hook, support OTP/ PinInput usePinInput [OtpInput] Add a hook, support OTP/ PinInput usePinInput Feb 27, 2024
@michaldudak michaldudak added the new feature New feature or request label Feb 27, 2024
@dantman
Copy link

dantman commented Jun 28, 2024

2FA grew in popularity recently, and so did this component. I wonder about the impact passwordless (biometric, passkey, device, email link) authentification will have though.

The email link flow has the downside of a poor user experience if the device they are using to read the email and the device they are trying to login with are different. The alternative flow is one where a pin is emailed and entered the same way as an OTP could potentially become more common. That's actually the exact scenario that prompted me to make the web search that included this page as a result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

6 participants