OTP Input
Single <input> styled as N segmented one-time-code cells.
Entered: —
Usage
import {OTPInput} from 'kinu';
<OTPInput maxLength={6} />
Exports
| Name | Description | Rendered HTML |
|---|---|---|
| OTPInput | One-time code input | <input k="otp"> |
Notes
- Defaults to
type="password",inputMode="numeric",autoComplete="one-time-code", andpattern="\\d*"— iOS SMS autofill, paste, and password managers just work. - The visual cell count reads directly from the
maxlengthHTML attribute via CSSattr(), so just setmaxLengthand the cells follow. - Each cell is
--k-otp-cellwide (defaults to2.5rem); total input width ismaxLength × --k-otp-cell. Override the variable to resize.
_Source: src/components/otp/index.tsx