[Toolkit][Shadcn] Add input-otp recipe#3483
Conversation
|
Pattern example : Capture.video.du.2026-04-19.15-22-22.mp4 |
|
Separator example Capture.video.du.2026-04-19.15-23-37.mp4 |
|
Disabled example Capture.video.du.2026-04-19.15-24-57.mp4 |
|
Controlled example : Capture.video.du.2026-04-19.15-26-17.mp4 |
|
Four digits example : Capture.video.du.2026-04-19.15-29-04.mp4 |
|
Alphanumeric example : Capture.video.du.2026-04-19.15-30-18.mp4 |
|
Form example : Capture.video.du.2026-04-19.15-34-48.mp4 |
|
RTL example : Capture.video.du.2026-04-19.15-36-18.mp4 |
3c8459a to
daf82fa
Compare
5056e1b to
f38112f
Compare
f38112f to
199f327
Compare
Kocal
left a comment
There was a problem hiding this comment.
Thank you for your work, it's almost perfect! 👏🏻
I just have two comments:
- The absence of the
autocomplete=“one-time-code”attribute, which prevents autocompletion from a password manager, SMS, etc... - The absence of a title/aria-label
Input X of Yfor each<twig:InputOtp:Slot>, which prevents proper accessibility.
As suggestions:
- I think we can add the attribute to all
<twig:InputOtp:Slot>elements, not just the first one, but this needs to be double-checked - Since TwigComponents do not have the concept of
childrencomponents (like React or Vue), we'll need to make this explicit using<twig:InputOtp inputs="6">and<twig:InputOtp:Slot input="1">, for example (if you have a better name thaninput, go for it!)
PS: I force pushed your branch, but I didn't commit anything, I just rebased it "on reflex" 😅 you can force push again without worries
Add `autocomplete="one-time-code"` by default on every slot, and expose `input`/`inputs` props so each slot can render an "Input X of Y" aria-label. TwigComponents have no React-style children scope, so the total is passed explicitly on each slot rather than forwarded from the parent.
|
Thanks a ton for the careful review and the helpful suggestions! 🙏 Both points addressed:
And no worries about the rebase — that "force-push reflex" is a feature, not a bug 😄. Force-pushed the new commits, ready for another pass whenever you have a minute! |
|
About 2., this is related to #2522, I will try to work on it, I really don't like the current workaround 😅 🤞🏻 |
|
#3512 has been merged, I didn't tweak our skill yet, but I believe you can already starts to make this recipe better ;) |

Adds the
input-otprecipe to the Shadcn kit.Part of the split of #3467 into one PR per component, tracking #3233.
Snapshots will be regenerated after rework.