primitives
primitives copied to clipboard
[New Primitive] Pin / OTP input component
Feature request
It would be nice to have some sort of pin input for OTPs or email sent short codes for login.
Overview
Many user authentication strategies rely on sending a one-time password (OTP) or a short code that could be numeric or alphanumeric. You can of course use a simple input for that, but many sites implement one input box for each character which makes for a clear indication and leaves no room for whitespace. It also handles the paste event correctly.
Examples in other libraries
Who does this impact? Who is this for?
Anybody that needs to deal with OTPs
https://github.com/leonardodino/rci
There is an RFC for that, from @benoitgrelard: https://github.com/radix-ui/primitives/pull/1978
Appears that RFC hasn't had any activity in 9 months
Additional examples
- https://park-ui.com/docs/tailwind/components/pin-input
- https://ark-ui.com/docs/components/pin-input