[**@fungi.computer/caps**](../README.md) --- [@fungi.computer/caps](../README.md) / components/code-input # components/code-input ## Type Aliases ### CodeInputStatus ```ts type CodeInputStatus = "idle" | "invalid" | "accepted"; ``` What the caller has learned about the entered code. --- ### CodeInputProps ```ts type CodeInputProps = object & Omit< InputHTMLAttributes, "value" | "defaultValue" | "onChange" | "maxLength" | "size" >; ``` Props accepted by CodeInput. #### Type Declaration | Name | Type | Description | | ----------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `length?` | `number` | How many characters the code has. | | `value` | `string` | The current code. | | `onValueChange()` | (`value`) => `void` | Receives the code after a native edit or a normalized paste. | | `status?` | [`CodeInputStatus`](#codeinputstatus) | `invalid` shakes the slots in a cascade and marks them; `accepted` lifts them in a wave. Say what was wrong next to the field, as with any error. | ## Variables ### CodeInput ```ts const CodeInput: ForwardRefExoticComponent< object & Omit< InputHTMLAttributes, "value" | "defaultValue" | "onChange" | "size" | "maxLength" > & RefAttributes >; ``` A short code (a sign-in or pairing code) shown as one slot per character. It is a single native input underneath, so typing, pasting, one-time-code autofill and screen readers behave as they do on any text field.