Components
TextInput
Controlled text input with cursor, arrow-key navigation, and password masking.
A controlled text input for terminal apps. Supports block cursor, arrow-key cursor movement, backspace, placeholder text, and password masking.
Installation
Usage
Examples
Basic
With label and placeholder
Password mode
Multi-field form
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled value (required) |
onChange | (v: string) => void | — | Called on every keystroke (required) |
onSubmit | (v: string) => void | undefined | Called when Enter is pressed |
placeholder | string | '' | Shown when value is empty |
password | boolean | false | Mask characters as * |
focus | boolean | true | Whether this input captures keyboard input |
label | string | undefined | Optional label to the left |
theme | InkUITheme | darkTheme | Color theme |