OTP Field
A one-time-password field — a row of character slots that owns focus movement, paste, and completion.
Basic
Character 1
Show codeHide code
Magnitudes
magnitude sets the box size of every slot — md, lg, and xl.
Character 1
Character 1
Character 1
Show codeHide code
Grouped
groups splits the run with separators — [3, 3] renders the 123-456 shape. The counts must sum to length.
Character 1
Show codeHide code
Invalid
Passing error shows the message and flips every slot to the danger state.
Character 1
Code is invalid
Show codeHide code
Controlled
normalizeValue rewrites accepted characters while rejected ones surface through onValueInvalid, fed back as an error until the next valid keystroke clears it.
Character 1
Show codeHide code
Installation
import { OTPField } from "@makeplane/propel/components/otp-field";