# KptInputOtp (kpt-input-otp) A one-time code field (OTP/PIN) - N separate boxes with autofocus and paste support. Signal Forms. The value is a string (the characters joined). Import: `import { KptInputOtp } from '@konce-pt/angular';` ## Inputs / model - `value`: model (or `formField`) - `length`: number (default 6) - `integerOnly`: boolean - digits only - `disabled`/`invalid`/`touched`: boolean; `touch`: output ## Behavior Typing a character moves to the next box; Backspace goes back; pasting spreads the code across the boxes. ## Example ## Screen reader and keyboard The first cell has `autocomplete="one-time-code"`, so phones offer the code from an SMS; a code that arrives in one cell at once (autofill, an on-screen keyboard paste) is spread over the cells like a paste. `touch` fires when focus leaves the whole group - not after a paste, and not when moving between cells. ## Label and description `id` goes to the focusable element - the host never carries it; without one it is generated. A `div` with a role is not named by `label[for]`, so inside `kpt-form-field` it gets `aria-labelledby` pointing at the wrapper's label (unless `ariaLabel` is set), and the hint or error is added to `aria-describedby`. No `controlId` needed. The cells form a named `role="group"`; `id` goes to the first cell (clicking the label starts at the beginning), and each cell is named "Character 2 of 6" (`inputOtp.cell`). ## Tokens The boxes use `--kpt-form-field-*`. ## Read-only and required `readonly` shows the code but blocks typing and paste; `required` sets `aria-required` on the cells (`group` does not accept it). The value holds the typed characters **without gaps**: clearing a middle cell gives `"13"`, not `"1 3"`, while the cell itself stays empty on screen. ## Groups `groupSize` (default `0` = no groups) inserts a separator after every N boxes, counted from the left; `groupSeparator` sets the character (default `-`). With `length` 9 and `groupSize` 3 you get `[][][]-[][][]-[][][]`. The separator is purely visual (`aria-hidden`): the value is the bare characters (`"123456789"`), each box keeps its name "Character 4 of 9", and arrows/Backspace jump over it.