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

TextInput Stable WINMACLNX

A native text input. Always controlled — you manage the value via state.

Import

import { TextInput } from 'veloxkit'

Basic usage

const [value, setValue] = useState('')
 
<TextInput
  value={value}
  onChangeText={setValue}
  placeholder="Type something..."
  style={{
    padding: '10px 14px',
    background: '#14141A',
    borderRadius: 6,
    borderWidth: 1,
    borderColor: '#2A2A3A',
    color: '#F0F0F2',
    fontSize: 15,
  }}
/>

Props

PropTypeDefaultDescription
valuestringControlled value (required)
onChangeText(text: string) => voidCalled on every keystroke
onSubmitEditing() => voidCalled on Enter
placeholderstringPlaceholder text
placeholderTextColorstring#666677Placeholder color
secureTextEntrybooleanfalsePassword field
multilinebooleanfalseMulti-line mode
numberOfLinesnumber1Initial height in multi-line mode
autoFocusbooleanfalseFocus on mount
disabledbooleanfalseDisables editing
maxLengthnumberMax character count
keyboardType'default' | 'number-pad' | 'email-address''default'Input type hint
styleTextInputStyle{}Styles

Ref and focus

const inputRef = useRef<TextInputRef>(null)
 
<TextInput ref={inputRef} value={value} onChangeText={setValue} />
 
// Focus programmatically
inputRef.current?.focus()
inputRef.current?.blur()
inputRef.current?.select()  // select all text

Multi-line

<TextInput
  multiline
  numberOfLines={4}
  value={body}
  onChangeText={setBody}
  style={{ padding: 12, minHeight: 100 }}
/>