Skip to content

TextInput

widgetsinput

TextInput: a single-line text input field with optional command auto-completion support

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

PropTypeRequiredDescription
placeholderstringoptional
maskstringoptional
maxLengthnumberoptional
suggestionsstring[]optional
onChange(value: string) => voidoptional
onSubmit(value: string) => voidoptional
#input#text-input