stnd.build

OtpInput

The boxes of a one-time code: one character per box, focus moves on as you type, back on Backspace, a pasted code fills them all. value is the code so far (bind it); oncomplete is called once with the full code when the last box is filled. Digits only unless numeric is false.

Type Name Description
number length? How many characters (default 6).
string value? The code so far (bindable).
boolean numeric? Digits only (default true).
string label? What the group is called for screen readers.
boolean disabled?
(code: string) => void oncomplete?
<OtpInput bind:value label="Login code" oncomplete={(code) => verify(code)} />