Input
Single-line text entry for forms and filters.
One-time code or PIN as separate slots.
One-time code or PIN as separate slots. One native input so paste and autocomplete work. Not a row of Inputs.
Field-wrapped 6-digit code at md with a 3-3 separator. Variants shows other lengths, disabled and error.
Type or paste a 6-digit code
Wrap with Field. Default length is 6 with groups [3, 3]. Paste fills the concatenated value. Unlabeled needs ariaLabel.
One-time code / PIN as separate slots. Paste and autocomplete work. Not a row of Inputs.
import { InputOTP } from "agentic-ds-kit";From contracts/inputotp.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
| describedBy | string | No | — | Id(s) for aria-describedby on the input. Field passes its hint or error id. |
| id | string | Yes | — | — |
| length | number | No | 6 | — |
| groups | number[] | No | — | Slot counts per group; must sum to length. Default [3, 3] when length is 6, else [length]. Separator sits between groups only. |
| size | sm | md | lg | No | md | — |
| disabled | boolean | No | false | — |
| error | boolean | No | false | — |
| value | string | No | — | controlled |
| defaultValue | string | No | — | uncontrolled |
| onChange | function | No | — | (value: string) => void |
| onComplete | function | No | — | fires when value.length === length |
| pattern | digits | alphanumeric | No | digits | — |
| name | string | No | — | — |
| autoComplete | string | No | one-time-code | — |
| ariaLabel | string | No | — | required when not wrapped in Field |