guilhermerodz / input-otp

One time passcode Input. Accessible & unstyled.
https://input-otp.rodz.dev
MIT License
2.35k stars 47 forks source link

Masked OTP input #45

Closed aiyeola closed 3 months ago

aiyeola commented 3 months ago

Is your feature request related to a problem? Please describe. For OTP fields that collect sensitive information, like PIN or passcode in financial apps, at this time the package doesn't have an API to mask the entered value

Describe the solution you'd like A boolean value prop called masked can be passed to the InputOTP component, to either show a masked input or not.

guilhermerodz commented 3 months ago

hi @aiyeola thanks for your suggestion!

it seems your feature request does not have enough information on 1. what it does 2. what's the expect developer experience around it and 3. is there any way to implement that with the current library specification, even without a "masked" prop?

from what I understood in your feature request, adding a "mask" functionality is not really needed since you are always able to render whatever character you want to in the UI and have full control of it regardless of the library props, or input type.

aiyeola commented 3 months ago

Hi @guilhermerodz you're correct!

yes, the alternative was to render a "masked" character in place of char

image

Thank you for your prompt response.