InputOTP
StorybookA segmented code input for OTP codes, PINs, and verification tokens. Each character gets its own visual slot with blinking caret animation.
Default
6-digit OTP with two groups of 3, separated by a dash. Type digits to fill slots left-to-right.
4-Digit PIN
A simple 4-digit PIN input in a single group.
Alphanumeric
Accepts letters and digits with pattern="alphanumeric".
Custom Pattern (Hex)
8-character hex code with pattern="[a-fA-F0-9]".
Try typing "g" — rejected. Type "a" or "f" — accepted.
With Separators
3 groups of 2 with separators between each group.
Disabled
Pre-filled and disabled. Slots show the value but input is not focusable.
Hybrid
Client instant + server notification via on_value_change and
on_complete.
Server-controlled
Server owns the value via the value assign.
Buttons set the value from the server. Typing notifies but doesn't update locally.
value=123
Form Integration
Inside a <.form> using
form_field with type="input_otp".