TextInput
input
TextInput: a single-line text input field with optional command auto-completion support
Terminal
$termuijs render text-input
Installation
$ bunx termuijs add text-input
Copies the source into src/components/text-input/ and installs @termuijs/core, @termuijs/widgets.
Usage
ts
import { TextInput } from '@termuijs/widgets'ts
new TextInput(style: Partial<Style> = {}, options: { placeholder?: string; mask?: string; maxLength?: number; suggestions?: string[]; onChange?: (value: string) => void; onSubmit?: (value: string) => void; } = {},)API Reference
TextInput
| Prop | Type | Required | Description |
|---|---|---|---|
placeholder | string | optional | — |
mask | string | optional | — |
maxLength | number | optional | — |
suggestions | string[] | optional | — |
onChange | (value: string) => void | optional | — |
onSubmit | (value: string) => void | optional | — |