TextInput

TextInputs allow users to input text.

Unfocused
Focused

Usage

class MyComponent extends React.Component {
  state = {
    text: ''
  };

  render(){
    return (
      <TextInput
        label='Email'
        value={this.state.text}
        onChangeText={text => this.setState({ text })}
      />
    );
  }
}

Props

disabled
Type: boolean
Default value: false

If true, user won't be able to interact with the component.

label
Type: string

The text to use for the floating label.

placeholder
Type: string

Placeholder for the input.

onChangeText
Type: Function

Callback that is called when the text input's text changes. Changed text is passed as an argument to the callback handler.

underlineColor
Type: string

Underline color of the input.

multiline (required)
Type: boolean

Whether the input can have multiple lines.

numberOfLines (required)
Type: number

The number of lines to show in the input (Android only).

onFocus
Type: Function

Callback that is called when the text input is focused.

onBlur
Type: Function

Callback that is called when the text input is blurred.

value
Type: string

Value of the text input.

style
Type: any
theme
Type: Theme
...TextInput props