Skip to content

[otp field] Add a OtpInput or PinInput component #75

Closed

Description

@marcpachecog

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

Activity

  1. added
    status: waiting for maintainer
    on Jan 16, 2024
  2. removed
    status: waiting for maintainer
    on Jan 16, 2024
  3. removed their assignment
    on Jan 17, 2024
  4. michaldudak commented on Jan 17, 2024

    @michaldudak
    Member

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

  5. changed the title [-][base-ui] Add a hook to manage OTP Inputs `usePinInput`[/-] [+][base-ui] Add a hook, support OTP/ PinInput `usePinInput`[/+] on Jan 17, 2024
  6. oliviertassinari commented on Jan 17, 2024

    @oliviertassinari
    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.

  7. TheOneTheOnlyJJ commented on Feb 3, 2024

    @TheOneTheOnlyJJ

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

  8. oliviertassinari commented on Feb 27, 2024

    @oliviertassinari
    Member

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

  9. changed the title [-][base-ui] Add a hook, support OTP/ PinInput `usePinInput`[/-] [+][OtpInput] Add a hook, support OTP/ PinInput `usePinInput`[/+] on Feb 27, 2024
  10. added
    type: new feature
    on Feb 27, 2024
  11. dantman commented on Jun 28, 2024

    @dantman

    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.

  12. added
    waiting for 👍
    on Feb 19, 2025
  13. changed the title [-][OtpInput] Add a hook, support OTP/ PinInput `usePinInput`[/-] [+][OtpInput] Add a OtpInput or PinInput component[/+] on Feb 19, 2025
  14. changed the title [-][OtpInput] Add a OtpInput or PinInput component[/-] [+][ott] Add a OtpInput or PinInput component[/+] on Apr 30, 2025
  15. changed the title [-][ott] Add a OtpInput or PinInput component[/-] [+][otp] Add a OtpInput or PinInput component[/+] on Apr 30, 2025
  16. added
    scope: new proposal
    on Aug 10, 2025
  17. controversial commented on Aug 11, 2025

    @controversial

    Note this component is now available in Radix

  18. oliviertassinari commented on Aug 11, 2025

    @oliviertassinari
    Member

    Note this component is now available in Radix

    @controversial Thanks for flagging, added to the list above. However, it's not usuabe for me on Android with the SwiftKey keyboard.

  19. linear commented on Mar 22, 2026

    @linear
  20. moved this from Future to Recently completed in Base UI public roadmapon Apr 10, 2026
  21. github-actions commented on Apr 10, 2026

    @github-actions

    This feature will be available in the next npm release of Base UI.

    In the meantime, you can try it out on our Canary release channel:

    npm i https://pkg.pr.new/@base-ui/react@4365
  22. removed
    waiting for 👍
    on Apr 13, 2026
  23. changed the title [-][otp] Add a OtpInput or PinInput component[/-] [+][otp field] Add a OtpInput or PinInput component[/+] on May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: otp fieldscope: new proposaltype: new feature

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions