Post by Javed Ansari

Day 2/8 - Interactive OTP Input by Javed Ansari

I set out to build an animated component and thought I’d use Motion and shadcn UI. But after seeing shadcn rely on another library, I decided to make my own from scratch. When I asked AI for help with animation, it gave me pretty complex solutions with JavaScript and refs. After digging into its code, I realized I could achieve the same thing just using CSS variables—no extra libraries needed. For the rest (like button states), I used AI for suggestions but tweaked everything for simplicity.


My main takeaway: AI can help write code, but if you don’t supervise it, you might end up with something unnecessarily complex. Use AI as an assistant, not a replacement for your own ideas.


Check it out live: https://otp-ofcljaved.vercel.app/

Source code: https://github.com/ofcljaved/otp/

Your upvotes and feedback are welcome!

Words have more power than we think. Be kind.