🚧 Glyx is pre-release software. APIs may change before v1.0. Get started →
Documentation
Form Components
TextInput

TextInput Stable WINMACLNX

A native text input. Always controlled — you manage the value via state. Supports caret-follow panning (single-line), auto-growing height (multiline), masking, numeric filtering, character limits, keyboard navigation, and mouse drag selection.

Import

import { TextInput, PasswordInput, NumericInput } from '@glyx-dev/react'

Basic usage

const [value, setValue] = useState('')
 
<TextInput
  value={value}
  onChangeText={setValue}
  placeholder="Type something..."
/>

Props

PropTypeDefaultDescription
valuestring''Controlled value
onChangeText(text: string) => voidCalled on every accepted edit
onSubmitEditing(text: string) => voidCalled on Enter (single-line only)
placeholderstring''Shown when unfocused and empty
fontSizenumber16Text size
multilinebooleanfalseMulti-line mode (Enter inserts \n)
widthnumber240Base width — flex/stretch styles override it; panning and wrapping always use the real laid-out width
heightnumber44 / autoExplicit height. Multiline default: auto-sized between minLines and maxLines
minLinesnumber3Multiline auto-height floor (in lines)
maxLinesnumber10Multiline auto-height ceiling — the field grows with content between the two
maxLengthnumberHard character limit; typing/paste beyond it is truncated
secureTextEntrybooleanfalseMask every character (password entry)
keyboardType'default' | 'numeric' | 'decimal''default'Input filter: numeric = integers, decimal = one dot allowed
styleGlyxStyle{}Container styles (merged over the built-in input chrome)

Interaction model

  • Caret-follow panning (single-line): typing past the right edge pans old characters out of view; deleting pans back. Click positions the caret even in the panned region.
  • Mouse selection: click sets the anchor, drag extends the selection — in both single-line and multiline fields.
  • Keyboard: arrows (+Shift to select), Home/End, Ctrl+A/C/X/V, Backspace/Delete on selections, Up/Down across lines in multiline.
  • Multiline caret blinks on the correct visual line, including soft-wrapped lines.

Multiline

<TextInput
  multiline
  minLines={3}
  maxLines={12}
  value={body}
  onChangeText={setBody}
  placeholder="Details…"
/>

Without an explicit height, the field renders minLines tall and grows with content (counting both newlines and soft wraps at the real field width) up to maxLines.

PasswordInput

Single-line TextInput with secureTextEntry forced on — characters render as , and caret/click/selection all track the masked glyph widths.

<PasswordInput value={pw} onChangeText={setPw} maxLength={64} />

NumericInput

Single-line TextInput that only accepts numbers. Defaults to keyboardType: 'decimal' (digits, one dot, leading minus); pass keyboardType: 'numeric' for integers only. Invalid keystrokes and pastes are rejected outright.

<NumericInput value={amount} onChangeText={setAmount} keyboardType="numeric" />

See also