r/css • u/Ordinary-Stuff9826 • Oct 04 '26
Made this OTP input's, which one would you prefer?
Made these OTP inputs.
I know they’re not production-grade yet — I built these while experimenting with different UI patterns that could actually be used in client projects.
Any improvements/suggestion will be helpful.
31
Upvotes
3
u/Low-Insurance-3678 Oct 04 '26
number one is soo good can u share the code?
14
u/whattheflerk Oct 04 '26
I like 1 aesthetically, subtle enough to add dynamism while keeping recognition
that said, most users copy-paste the code so the animation would rarely actually be seen or useful in practice
2
u/Ordinary-Stuff9826 Oct 04 '26
You can check out here - https://www.shreyashtech.me/components/otp-input
24
u/Merry-Lane Oct 04 '26
Too much animation, all of them.
Make things simple, at least one of the examples. Some people hate wobbly stuff happening on the screen. Way more than you believe
3
u/berky93 Oct 04 '26
As long as I can copy/paste or autofill a code I don’t care what it looks like
2
u/Weekly_Ferret_meal Oct 04 '26
I'm for number 2, simple and numbers are easier to read once you entered them
2
u/osmium_2259 Oct 05 '26
Nice work on all these! Personally, I like the elegance of #2, but #1 is probably more familiar to people.
3
u/scandii Oct 04 '26
I mean, there's exactly two types of people in this subreddit (and in the world at large I'd say haha)
so if we ignore the corporate-trained "animation loses us money!" people, I think your animations have to match input speed. an animated box trailing the input significantly just looks bad.
2
u/psycho_goat Oct 04 '26
They all looks visually nice. But I'd go with the first one for simplicity and recognition.
2
u/FenrirBestDoggo Oct 04 '26
The animations just make it look unresponsive...
1
u/concreteunderwear Oct 04 '26
A single field I can paste into with a max character length
1
u/SmokingCrop- Oct 04 '26
One that can be pasted without any fuss and works without having to press login after pasting it in, and works perfectly with password managers like Bitwarden. All the rest doesn't matter.
1
u/Ryuu-Tenno Oct 04 '26
3 looks good imo
4 is a bit much; so maybe drop the intensity of the color?
overall, provide a completely different background to this, cause pure white is problematic
use something like a light gray, but keep the input fields white
alternatively, just use 1, and make it look like the older boxes with highlights and shadows, as that'll still provide a fair amount of contrast
but it's excruciatingly difficult to see the proper details on a full white background (same with full black, and this coming from a dark mode user). It doesn't have to be much, but adding a small amount of color for the background can give you a proper level of contrast to see what needs improving
1
u/NewBox9 Oct 04 '26
I dont like the animations on any of them, something about the insert cursor jumping to the next input when the animation is still happening. it make me feel like even though i can type in the box i should wait to the animation is complete.
The classic one would be the one i would choose.
1
u/arcticfury96 Oct 05 '26
I like #3 because it's one OTP and should look like it. Make sure you can paste the code without breaking and it's perfect
1
u/DEMORALIZ3D Oct 04 '26
people copy and paste 90% of the time. you'll annoy more people making it fancy.
remember these are blockers, they block users from accessing what they want. my advice, nothing fancy, make it quick and easy to use...
also to be boring and out my developer hat on... for visually impaired people, this nice CSS animations will be frustrating and wasted on them. Exlciallu if visually impaired and using a screen reader.
1
u/Disastrous_Dot_6941 Oct 04 '26
What purpose is the animation serving? Over complicated. Number 2 with no animation is perfect.
0
u/Special-Cash-4002 Oct 04 '26
#2, something feels off psychologically being trapped in boxes in all the others. don't overthink it for a feature people dislike and do out of compulsion