Labeling
- Pair the field with a visible
Label. PinFieldInputis the semantic form control and should carry form-related attributes.
Keyboard Behavior
AnnouncementFocus the demo and press a key from the table.
| Key | Action |
|---|---|
| Backspace | Deletes the character before the caret. The focus stays in the field, it is one input behind the slots. |
- Keyboard input is handled through
PinFieldInput. - Arrow keys move the active slot position; Up and Home go to the start, Down and End to the end.
- Shift with an arrow key extends the selection natively.
Focus Behavior
- Focus lands on
PinFieldInputwhile visible slots reflect the active state. - Blur clears the active slot indicator.
Screen Reader Semantics
PinFieldInputkeeps the field accessible to assistive technology and browser autofill.- Visible slots are presentation for the segmented view of the same value.
Form Semantics
- Put
name,required, and other form props onPinFieldInput. - Keep slot count aligned with
maxLength.
Accessibility Risks
- omitting
PinFieldInput - relying only on visible slots without a real backing control
- unclear labeling for OTP or verification flows